“Error establishing a database connection”
WordPress keeps every post, page and setting in a MySQL database. This message means it couldn't connect to that database at all, so it has nothing to show. The whole site, including the admin, shows the same sentence.
Is your site showing it right now?
The free scan loads your page like a visitor and checks for this message, plus broken links, script errors and phone layout. It also walks your signup, booking or contact form, without sending anything.
Free, no signup. Usually done in about a minute.Why it happens
- The database name, user, password or host in wp-config.php no longer match (common after moving hosts or changing a password)
- The database server is down or overloaded, often during a traffic spike or a problem at your host
- A damaged database table
How to fix it
Check whether it's your host
Look at your host's status page or support chat first. If their database servers are having trouble, there's nothing to change on your side; it comes back when they fix it.
Compare the details in wp-config.php
Open wp-config.php in your host's file manager and compare DB_NAME, DB_USER, DB_PASSWORD and DB_HOST with the database shown in your hosting control panel. If the password was changed, set the same new password in both places.
Repair the database
Add define('WP_ALLOW_REPAIR', true); to wp-config.php, open yoursite.com/wp-admin/maint/repair.php and choose "Repair Database". Remove that line straight after: the repair page needs no login while it's there.
Ask your host to restart the database
If the details match and the repair doesn't help, the database server itself needs attention. Hosts can restart it or tell you if your plan's connection limit is being hit.
Questions
Why does the admin show a different message?
On /wp-admin, WordPress sometimes says "One or more database tables are unavailable". That points to damaged tables: use the repair step above.
Will repairing the database delete anything?
No. The repair tool fixes table structure; it doesn't remove posts or settings. Taking a backup first is still a good idea.
Can Page Canary tell me if this comes back?
Yes. Page Canary checks your key pages every day for this message and others like it, confirms it on a second check, and emails you with the fix. One site is free.