How do I fix “Error Establishing a Database Connection” in WordPress?

Home » Common WordPress Questions » How do I fix “Error Establishing a Database Connection” in WordPress?

This is one of the most common and alarming errors in WordPress. It means your website’s PHP code cannot communicate with the MySQL database where your content is stored. This usually happens for three reasons: your login credentials in the wp-config.php file are incorrect, your database has become corrupted, or your hosting server is overwhelmed and unresponsive.

To fix it, we first verify your database credentials. If those are correct, we may need to run the WordPress built-in “repair” tool or contact your host to see if the database server has crashed. Because this error takes your site offline instantly, it’s a high-priority fix. Our maintenance clients benefit from uptime monitoring, which alerts us the second this error occurs so we can jump in and restore the connection before you even realize there was a problem.

Stop Stressing Over WordPress

Whether you’re dealing with a slow site, security scares, or broken updates, you don’t have to fix it alone.
Let’s talk about a care plan that keeps your site running perfectly 24/7.

Get WordPress Help