Scroll Top

How I Efficiently Restored a WordPress Database

How I Successfully Restored a WordPress Database

All blog owners know the importance of backups but it can happen to forget to make regular copies.

Often we realize the importance of the backup when it is too late, ie when it would be very useful to have the data to retrieve.

There are loads of plugins available to copy your blog. Install your favourite backup plugin as soon as possible.

You will lose ten minutes to setup and configure it but will save time and stress at the right time.

Below the steps I made to restore a WordPress backup.

I’m talking about a WordPress 3.2.1 running on a cPanel hosting platform.

I accidentally deleted the entire WordPress database. I’ve gotten this error: “error establishing a database connection “.

Although it may seem like the worst possible situation, perhaps it is more difficult retrieve only parts of a database.

Using a Ftp client or a File Manager:

1) Duplicate the backup file. At this time the backup file is essential.

2) Retrieve some essential information from the file wp-config.php. Open the file with a text editor and take note of these 3 settings:

  • DB_NAME
  • DB_USER
  • DB_PASSWORD

Using cPanel database administration tool:

3) Create a database named as in DB_NAME.

4) Create a user named as in DB_USER, with password as in DB_PASSWORD

5) Associate now the new user to the new db and give it all rights.

Now that we have an empty database with the right settings, we can repopulate the data using the backup file.

Using PhpMyAdmin tool:

Position yourself in the newly created database by selecting in the left column. The program will warn you that there are no tables in the database.

Click on the “Import” item at the top right.

This will open a page where you can load our backup files, either in Sql format or in a compressed format.

Usually the other values can be left set to defaults.

6) Confirm the operation by clicking the Import button at the bottom of the page.

At this point your PhpMyAdmin should show the repopulated tables in the left column

You can close PhpMyAdmin, cPanel and try to get in your blog. You have lost the changes since the last backup, but the blog is now up and running again.

This was just one possible scenario, probably the simplest, and certainly there are other ways to recover data lost.

I think anyway this simple article can be useful even just as a list of steps needed to be done to then adapt it to your situation.


wp error establishing a database connection
#Successfully #Restored #WordPress #Database

Will be pleased to have you visit my pages on social networking .

 Facebook page here.

Twitter account is here.

Linkedin account here

Post byBedewy for info askme VISIT GAHZLY

Related Posts

Privacy Preferences
When you visit our website, it may store information through your browser from specific services, usually in form of cookies. Here you can change your privacy preferences. Please note that blocking some types of cookies may impact your experience on our website and the services we offer.