Short answer: WordPress could not connect to the database using the credentials and host in wp-config.php. That can be a wrong credential, a stopped database service, a connection limit or corruption — and the difference decides everything you do next. In most cases the data is intact.
Triage before touching files
- Does it affect one site or every site on the account? Every site down points at the database server, not your config.
- Is the host’s status page reporting an incident?
- Was there a migration, a password change or a deployment just before?
- Has the account hit its disk quota or its maximum connections?
Check the four values in wp-config.php
Open wp-config.php and confirm DB_NAME, DB_USER, DB_PASSWORD and DB_HOST against what your hosting panel shows. DB_HOST is the usual trap — it is localhost on many hosts but a specific server name or socket path on others. Do not overwrite the whole file with a fresh one: you would strip the table prefix, salts and environment constants. Compare values instead, and never paste the file’s contents anywhere public — it holds your database password.
Test the connection directly
If the credentials look right but it still fails, test whether the database itself responds. Log in to phpMyAdmin or your host’s database tool with the same DB_USER and DB_PASSWORD. If that login fails too, the credential or the user’s privileges are the problem. If it succeeds, the issue is in how WordPress reaches the server — often DB_HOST or a service that is down.
When a table is corrupt, not the connection
If the service responds but WordPress still errors on some pages, a table may be marked as crashed. WordPress has a built-in repair mode: add define('WP_ALLOW_REPAIR', true); to wp-config.php, visit /wp-admin/maint/repair.php, run the repair, then remove that line immediately — leaving it on exposes a repair endpoint to the internet. Take a database backup before running it.
Verify with a real page
Load the front end, sign in to the admin, open the post editor and run a search. A home page served from cache can hide a database that is still refusing writes, so test something that reads and writes, not just the cached front page.
WP REPAIR INCIDENT STANDARD
Safe intervention sequence
The message covers several different failures: invalid credentials, an unreachable database service, exhausted connections, disk pressure or damaged tables. The order of checks prevents a configuration guess from becoming data loss.
- Confirm whether every site using the same database server is affected.
- Compare DB_NAME, DB_USER, DB_HOST and privileges without publishing wp-config.php.
- Test the same credentials directly from the hosting database tool or command line.
- Check disk space, connection limits and the database service log before attempting table repair.
What must be verified
- Front end and admin queries both work.
- A controlled write persists and can be read back.
- No connection or crashed-table errors appear in the database log.
Official technical sources
Continue the diagnosis
This guide explains the diagnosis. If the site is affected now, the intervention should preserve a rollback path and verify the real business journey.
See the emergency repair service →