Fixing Databases after restore Print

  • 2

After you have restored your database you may get an error when trying to view a page that users the database (forum, script, phpmyadmin etc).

Warning: mysql_connect(): Access denied for user: 'domain_dbse@localhost' (Using password: YES) in
/home/domain/public_html/forum/includes/database.php on line 13
Unable to connect to database server!

This means that your database now exists in cpanel, but it has no mysql username and password assigned to it. To assign a username and password login to your cpanel and click "mysql databases" and add the user, and assign appropriate rights to it.

Your username will look something like this yourusername_databasename@localhost
The username in our example error above is "domain_dbse"
You will need to find out your database password for scripts/forums etc. To do so look at the error your page gave you and take notice of the path.

Path from our example error:
/home/domain/public_html/forum/includes/database.php on line 13 Login to your site by FTP and go through to the approprate folders/path until you find the file listed in your error. Download the file to your computer. Once it has been downloaded, open the file and look for your database password. Look for a line like
DB_SERVER_PASSWORD = ('abc123xyz');

Now fill that password in for the database password, and and then press "add user"

The user has now been added, but it has not been assigned to a database.

Match up the user with the database it belongs to and then just click "add user to database"

All done! If it doesn't work you missed a step somewhere and should create a support ticket here for assistance.


Was this answer helpful?

« Back