Reconnecting your Database

Getting your database to work after restoring it:

After you have restored your database, you will get an error when trying to view it's page.

Example Error:

Warning: mysql_connect(): Access denied for user: 'bakerpe_osc1@localhost' (Using password: YES) in /home/bakerpe/public_html/catalog/includes/functions/database.php on line 19
Unable to connect to database server!

What this means is that your database now exists in cPanel, but it has no username and password assigned to it. To assign a username and password, login to your cPanel and click "MySQL Databases".  Scroll down until you see the required field boxes below: see the required information fields below:

Your username will look something like this: yourusername_databasename@localhost. The red part would be your username. The username in our example error above is "osc1"

You will need to find out your databases password.  To do so, look at the error your page gave you and take note of the path.

Path from our example error:

/home/bakerpe/public_html/catalog/includes/functions/database.php

You will now login to your sites FTP and go through the folders until you find the file listed in your error path.

You will now download the file to your computer. Once it's downloaded open it up and browse until you find your database password.

Example of what to look for: DB_SERVER_PASSWORD\', \'nvGHdCC0dCMz\');

nvGHdCC0dCMz would be our database password. We will now fill that password in for our 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"

You are done! If it doesn't work, you have made a mistake somewhere in these directions and might have to try again. Contact Technical Support for more information.

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Making a Partial Backup (seperate home directory, databases etc))

Step 1 To make a backup of your site and databases you first need to login to your cPanel screen...

Restoring a Partial Backup

Step 1 To restore a backup you first need to log into your cPanel screen and click on the...

Purchase a backup plan (Strongly Recommended)

Keep your website data safe.  Order one of our low cost backup plans today.  Starting from just...

Making A Full Backup (Recommended)

** Shout Hosting recommends that you create full backups of your account on a weekly basis **...

Restoring A Full Backup

To restore a full back please open up a new support ticket and send us a copy of your backup...

Powered by WHMCompleteSolution