WordPress Problems: Error Establishing a Database Connection


Every now and then every WordPress user and/or developer will run into this common problem: A big white screen with the message “ERROR ESTABLISHING A DATABASE CONNECTION”.

Never fear, there are a few quick tips to get your website back to running smoothly. Usually this error occurs when your hosting provider is working on your hosting account. What this means is that the MySQL database, essentially the brains of WordPress, isn’t communicating with the rest of the content. In order to fix this problem, we have to look at two things. Either A: your hosting divided by zero which resulted in the MySQL database not working properly or B: you altered your WordPress config file and something went amiss.

I’ve noticed, when I have run into this issue, it’s usually the hosting account and hosting provider running a quick reboot on the SQL database which then caused a blackout. Usually, a quick cache refresh will solve this error and, if that does not fix the error, contacting your hosting provider and double checking they aren’t running into any server issues or fixes on your website.

If you run a few custom configurations on your WordPress configuration file, always save the original that WordPress generates. I always do that just in case I have to work some crazy magic on the file and things don’t go according to plan.

Sometimes people will do a complete update of all their passwords and usernames, including their SQL database password for the user account which will cause stuff to EXPLODE, i.e. disconnects the SQL database from WordPress.

The easiest way to fix this is to call Tech Support and inquire if they changed your MySQL password. If they changed your password, just go into their website via FTP, open up the WordPress config file and put in the new password. Then the website should be back online, I know that probably sounds very “technical” but it’s not really a big deal, just a simple password change and your website goes back up.

I hope this helps clear up a few things, because I have been called to fix this connection error and it’s nothing to be afraid of. It can be fixed. Your website isn’t lost, you just need to fix a few things and you will be back online in no time!