It might occur to forget to make copies that are regular although all website owners understand the need for backups Error Establishing A Database Connection Wordpress.

Frequently we recognize the need for the back-up when it's too late, ie when it will be very useful to have the information to retrieve.

There are loads of plugins open to replicate your blog. Install your favourite back-up plugin as soon as possible.

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

Below the measures I made to restore a WordPress copy.

I am referring to a WordPress 3.2.1 running on a cPanel hosting platform.

I inadvertently deleted the whole WordPress database. I have gotten this error: "error establishing a database connection ".

Even though it might seem like the worst possible scenario, maybe it is more difficult retrieve only parts of a database.

wordpress expert

Using an Ftp client or a File Manager:

Recover some fundamental information in the file wp-config.php. Open the file with a text editor and be aware of those 3 settings:

Only at that time the backup file is essential.

DB_NAME

DB_USER

DB_PASSWORD

Using database administration tool that is cPanel:

3) Create a database named as in DB_NAME.

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

Now that we've an empty database with all the proper settings, we can repopulate the data utilizing the backup file.

freelance wordpress developer

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

Click on the "Import" thing at the top right.

This may open a page at which you can load our backup files, either in a compressed format or in Sql format.

Generally the other values may be left set to default options.

6) Confirm the operation by simply clicking the Import button in the underparts of the the webpage.

Only at that point your PhpMyAdmin should show the repopulated tables in the left column

You are able to shut PhpMyAdmin, cPanel and try to get in your website. You've lost the changes since the last back-up, but the blog is now up and running again.

This was just one possible scenario, likely the most straightforward, and certainly there are other ways to recoup data lost.

I believe anyhow this straightforward article might be useful even as a record of measures had a need to be performed to subsequently adapt it to your own scenario.