One of a solution to fix the problem "Error establishing a database connection" happens in…
Somehow my blog got stuck after loading the page up to the post’s title. After trying deactivating plugins, changing themes, removing unnecessary stuffs,… the problem was still there. My brain started bouncing back and forth that “What can I do now? how to fix it; how to bring back my site;… I don’t know, I don’t knowwwwww,” but somehow I was accidentally hitting up to the page “repair.php”, then I started following the steps. Fortunately, it worked and the blog was back to normal. Cools. I know some of you sometimes has the same problem likes what I just got, so I decide sharing whatever I’ve done as the following tips.
- Add the following code to wp-config.php file
- Paste the following web address to your browser window.
- Click “Repair Database” or “Repair and Optimize Database“
- Done. It shows a completed details how your database is.
- Don’t forget removing the line of code which you added to wp-config.php at step #1. (Remove “
*** NOTE ***
Before doing anything, remember to backup the database first so if there is something wrong, you still have a chance making your site back.
Is there an alternative way to fix the database?
Yes. You can optimizing the database, repairing the database tables,… from your PhpMyAdmin.