A client's WordPress site is down on the white database error page. Here is how to find the cause and get it back online fast.
WebNewBiz TeamChecked against each platform's own help pages
A client calls: their WordPress site is a blank white page that says 'Error establishing a database connection', and nothing else loads, front end or wp-admin. It happens to anyone running WordPress, and it is scary because the whole site is down at once. This guide shows you how to tell which cause you have, fix it in the right order, and tell a simple reachability problem apart from real data loss.
On this page
WordPress stores every post, page, product, order and setting in a MySQL database. On each request it opens a connection to that database using the details in a file called wp-config.php. When it cannot open that connection, or cannot log in, it stops and shows this one message instead of your site.
So the problem is almost always one of three things: WordPress is using the wrong login details, the database server is not answering, or the data it reaches is damaged. The good news is that the first two do not touch your content at all. Before you change anything, take a backup of the database if you can still reach your hosting panel, so a reachability problem can never turn into real loss.
Match your symptom to the likely cause, then jump to the matching fix. Work top to bottom.
| Symptom | Likely cause | Go to |
|---|---|---|
| Error started right after you edited wp-config.php, changed a database password, or migrated the site to a new host | Wrong credentials in wp-config.php | Fix 1 |
| Every site on the same server is down, or your host status page shows an outage, or the database hit its storage quota | MySQL server is down or full | Fix 2 |
| Error comes and goes, worse at busy times or during a sale, clears by itself after a few minutes | Too many connections | Fix 3 |
| Front end loads but wp-admin says the database may need repair, or only some pages break | Corrupted tables | Fix 4 |
One quick check before you touch anything: try to open yoursite.com/wp-admin. If it shows a slightly different message saying 'One or more database tables are unavailable. The database may need to be repaired', that points at corruption (Fix 4). If both the front end and wp-admin show the same plain connection error, you are looking at credentials or the server (Fix 1 or Fix 2).

WebNewBiz runs client sites on managed WordPress on Google Cloud, so the database, wp-config and connection limits are handled for you.
The official WordPress docs say this error is usually caused by an error in your wp-config.php file. This is the first thing to check, especially if the site broke right after a change or a move to a new host.
How to check it worked: the site loads normally and wp-admin logs in. If you changed the database password recently, the fastest fix is to set DB_PASSWORD back to the exact password on the live database user, not the other way around.
If the credentials are definitely correct, the WordPress docs point at two host-side problems: the database has met its quota and been shut down, or the server is down. The MySQL manual lists the same symptom from the server side: a 'Can't connect' result normally means no server is running or the host and port it is reached on are wrong.
How to check it worked: once the host confirms the server is up and the database is under quota, reload the site. Nothing in your content changes here, so the site should return exactly as it was.
MySQL only allows a fixed number of open connections at the same time. The official MySQL manual explains this is controlled by the max_connections setting, which defaults to 151. When traffic spikes, a sale, scheduled cron jobs, or a heavy plugin use them all, WordPress cannot open a new connection and shows the same database error. It often fixes itself within a few minutes as connections free up.
How to check it worked: the site stays up through your next busy period without the error returning. If it keeps coming back daily, the real answer is more database capacity, not a one-off reset.

If wp-admin tells you the database may need repairing, or only parts of the site break, one or more tables may be corrupt. WordPress has a built-in repair tool. Back up the database first, because repair changes the tables.
How to check it worked: the page reports the tables as repaired, and the site and wp-admin load normally. If repair cannot fix a table, restore the database from your most recent clean backup instead.
Collect these before you escalate, so support does not have to ask: the exact error text, when it started, what changed just before (an edit, a password change, a migration, a traffic spike), whether other sites on the server are affected, and the DB_NAME and DB_HOST from wp-config.php. Note whether wp-admin shows the plain connection error or the 'tables unavailable' message.
Then open a ticket with your host, since the database server, its quota and its connection limit are on their side. For the error itself, the official reference is the WordPress common errors guide and the wp-config.php documentation. If the site had been unreachable for a while and you suspect more than a down server, a reachability issue can sometimes look like a network timeout instead, covered in Cloudflare error 522.
Does 'Error establishing a database connection' mean I lost my data?
Usually no. The message means WordPress cannot reach or log into the database, not that the data is gone. In most cases the credentials are wrong, the MySQL server is down, or it ran out of connections, and the content is still there. True corruption is rarer and often shows a different message on wp-admin. Always take a backup of the database before you change anything, so a reachability problem never turns into real loss.
Where is the wp-config.php file and what do I change?
wp-config.php sits in the root folder of your WordPress install, the same folder as wp-load.php, reached over FTP, SFTP or your host's file manager. The four lines that matter are DB_NAME, DB_USER, DB_PASSWORD and DB_HOST. They must match the database name, username, password and host your hosting account uses. DB_HOST is 'localhost' on most shared hosting, but some hosts use a different server name, which you confirm in the host's database panel.
What does the 'Too many connections' error have to do with this?
MySQL only allows a set number of open connections at once, controlled by the max_connections setting, which defaults to 151. When traffic, cron jobs, WooCommerce background tasks or a heavy plugin use them all up, WordPress cannot open a new one and shows the database connection error. It often clears on its own within minutes. If it keeps happening, your host can raise the limit or move you to a bigger plan.
How do I repair a corrupted database table?
Add the line define( 'WP_ALLOW_REPAIR', true ); to wp-config.php, then visit yoursite.com/wp-admin/maint/repair.php in a browser. WordPress offers to repair, or repair and optimize, the tables with no login needed. Run it, then delete the line you added straight away, because leaving it on lets anyone reach that page. Take a database backup first, since repair changes the tables.
Why is only my WordPress site down and not the others on the same server?
Each WordPress install points at its own database with its own credentials in its own wp-config.php. One site can lose its connection because its password changed, its own database hit a quota, or its tables are corrupt, while the others keep running fine. If every site on the server is down at once, that points at the MySQL server itself being off or overloaded, and your host needs to look at it.
Most of this error comes down to the plumbing under WordPress: the database, the wp-config.php credentials and the connection limit. On WebNewBiz client sites run on managed WordPress on Google Cloud, so the database, wp-config and connection limits are managed for you, and you still get a full WordPress admin, hosting and SSL on every plan. It is a younger platform with a smaller plugin ecosystem than long-running hosts, and you cannot export the site as files to move it elsewhere, so it suits sites you are happy to run here.
You can start with a 3-day free trial with no card, or Create your website for $1: the first month is $1, then the plan's normal price (Starter is $19 a month), cancel any time. Agencies running many client sites can talk to us about white-label.
Describe your business and the AI builds your website, store and CRM. Try it free for 3 days, no card needed.