Blog / WordPress errors

WordPress error

Error Establishing a Database Connection

Your site went from working to a blank page with one line of text. Here is what is really going on behind it.

FixBugDev team · 5 min read

WordPress stores almost everything, your posts, pages, settings, even plugin configuration, in a MySQL database. This message means WordPress tried to talk to that database and got no answer. It is one of the few errors that has nothing to do with your theme or plugins, and everything to do with the connection between WordPress and its data.

What usually causes it

What to check first

  1. Compare wp-config.php against your hosting panel. The DB_NAME, DB_USER, DB_PASSWORD and DB_HOST constants near the top of the file need to match exactly what your host shows for that database.
  2. Check your host's status page. If other sites on the same server are also down, it is a hosting-side outage and not something in your code.
  3. Try repairing the database. Add define('WP_ALLOW_REPAIR', true); to wp-config.php, then visit yoursite.com/wp-admin/maint/repair.php and run the repair tool. Remove that line again once done, it is not meant to stay in production.

If the credentials check out and the repair tool does not fix it, the cause is usually deeper (a partially failed migration, a corrupted table beyond the repair tool's reach, or a hosting-side limit you cannot see from the dashboard). That is where it stops being a five-minute fix.

Launch price, limited time

We'll get your database talking to WordPress again

Send access to your hosting or FTP and we diagnose whether it is credentials, corruption, or a hosting-side limit, then fix it.

Simple Bug Fix
See pricing →