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
- Wrong credentials in
wp-config.php. If your host changed a password, moved your database, or you migrated recently, the database name, username, password or host saved inwp-config.phpno longer matches reality. - The database server is down. Shared hosting providers occasionally have database server outages that affect many sites at once.
- Too many connections. A traffic spike or a runaway plugin can exceed your hosting plan's connection limit, and MySQL simply refuses new connections until things calm down.
- A corrupted database table. Most often
wp_options, which every single page load reads from. If it gets corrupted (a bad plugin write, an interrupted import), the whole site goes down with it.
What to check first
- Compare
wp-config.phpagainst your hosting panel. TheDB_NAME,DB_USER,DB_PASSWORDandDB_HOSTconstants near the top of the file need to match exactly what your host shows for that database. - 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.
- Try repairing the database. Add
define('WP_ALLOW_REPAIR', true);towp-config.php, then visityoursite.com/wp-admin/maint/repair.phpand 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.
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.