How do I successfully restore a database WordPress

align = “justify”> by Borgy

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

Often we understand the importance of backup when it’s too late when they would be very useful to have data to retrieve.

There are plenty of plugins available to copy to your blog. Install your favorite plugins back to you as quickly as possible. You will lose ten minutes to set up and configure, but it will save you time and stress at the right time.

The steps I took to restore a backup WordPress.

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

I accidentally deleted the entire database WordPress. I get this error:. “Error establishing a database connection” Although it may seem like the worst possible condition, it may be harder to retrieve only parts of the database

Duplicate backup file .. Currently the backup file is needed.

Get some basic information from the file wp-config.php. Open the file with a text editor and take these 3 settings:

a) DB_NAMEb) DB_USERc) DB_PASSWORD

Using cPanel management tool database:

Creating a database named as the db_name.

Create a user named as DB_USER, with the password in DB_PASSWORD

Vice

now the new user to the new db and give it all right.

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

> Using phpMyAdmin tool:. Put yourself in the database recently created by selecting the left column. The program will warn you that there are no tables in the database.

Click on “import” feature top right. This will open a page where you can upload files backup our in either SQL or a compressed format.Usually other values ​​can be allowed to set default values. Confirm the action by clicking the Insert button at the bottom of the page.

At this point phpMyAdmin you should read the tables rebuilt in the left column

You can close the phpMyAdmin, cPanel and try to get to your blog. You lose your changes since the last backup, but the blog is now up and running again.

This was only one possible scenario, perhaps the simplest, and certainly there are other ways to recover lost data. I think anyway this simple article can be useful simply as a list of steps to be done to adapt then to your situation.