Last week, I entered to one of my blogs and found that I get error message “error establishing a database connection”, my blog contents are disappeared due to database connection cannot be established.
I’m so curious and felt weird about this issue since I didn’t change any setting from my blog, I also didn’t change something in wp-config.php for the base configuration of the WordPress, how come I get the error message “error establishing a database connection”?
What I have Been Done After This
1. I double confirmed the info keyed in in wp-config.php file like name of the database, username, password and local host. Hmm.. it is seems like nothing goes wrong!
2. I retrieved the backup copy from my email, create new database and give it a new database name, import the backup copy to this new database and then make new configuration in wp-config.php file. (change database name and password only) Wow..it is work!
Why It is work?
The backup copy is work, but the current database doesn’t work and show error establishing a database connection. Since the base configuration of the WordPress in wp-config.php doesn’t goes wrong, then I confirmed that there will be something wrong in my current database.
I guessed I need to repair all the tables in my current database, this can be done through phpMyAdmin. After repaired the database tables, my blog is back! It won’t show error message “error establishing database connection” anymore. That’s means my problem has been solved!