You go to check your website and instead of your homepage, you're staring at a plain white screen with six brutal words: "Error establishing a database connection." No explanation, no next step — just a dead site and a knot in your stomach. If this has happened to you, you're not alone. It's one of the most common and most disruptive errors WordPress site owners encounter.
The bad news: your entire website is down. Visitors can't see any of your content, your contact form isn't working, and if you run an online store, no one can buy anything. Every minute that message sits there is potential revenue walking out the door. The good news: this error almost always has a fixable cause, and understanding what's happening is the first step toward getting back online.
This article will walk you through what the WordPress error establishing a database connection actually means, what's involved in fixing it, and how to decide your best next move — without drowning you in technical jargon.
What Causes WordPress Error Establishing Database Connection
To understand this error, it helps to know a tiny bit about how WordPress works. Your website isn't stored as one big file — it's actually split into two pieces. There's the code and design files sitting on your web server, and then there's a database (think of it like a massive spreadsheet) that holds all your content: your posts, pages, settings, product listings, everything. Every time someone visits your site, WordPress reaches into that database to pull the right content. When it can't make that connection, you get the error.
Here are the most common reasons that connection breaks:
Wrong database credentials. WordPress uses a configuration file called wp-config.php to know how to connect to the database — the database name, username, password, and host. If any of those details are wrong or have changed, the connection fails. This often happens after a hosting migration, a server change, or when someone accidentally edits that file.
The database server is down. Your database runs on a server, and sometimes that server crashes or gets overwhelmed. This is usually on your hosting provider's end. It can happen during high traffic, after a server update, or due to a resource limit being hit.
A corrupted database. WordPress databases can become corrupted — meaning the data inside gets scrambled or damaged. This can happen after a failed plugin update, a bad WordPress core update, or even an unexpected server shutdown in the middle of writing data. A WordPress site down after plugin update is a surprisingly common trigger for this exact error.
Exceeded hosting resource limits. On shared hosting plans especially, there are limits to how many database connections can be open at once. A traffic spike, a runaway plugin, or a poorly optimized site can push you over that limit, causing the connection to fail.
Hacked or compromised site. In some cases, a hack can alter your database credentials or damage the database itself. If you've noticed other strange behavior recently, it's worth considering. You can learn more about warning signs in our guide to WordPress site hacked.
What Fixing WordPress Error Establishing Database Connection Actually Involves
Fixing this error isn't a single action — it's a process of elimination. A developer (or a technically capable person) will work through the likely causes in order from most common to least.
The first thing they'll check is the wp-config.php file to verify the database credentials are correct and match what's actually in your hosting account's database settings. This sounds simple, but getting into that file requires either FTP access or a hosting file manager, and a single wrong character in those credentials will keep the site down.
If the credentials look fine, the next step is checking whether the database server itself is running. This usually means logging into your hosting control panel, looking at the database service, and checking for any error logs or alerts. Some hosting providers have a status page that makes this obvious.
If the server is running but the site still won't connect, the database itself may be corrupted. WordPress has a built-in repair tool that can sometimes fix this, but accessing it requires editing a config file and knowing where to look. In more serious cases, someone may need to repair or restore the database tables directly — which means working inside a tool called phpMyAdmin or using command-line database commands.
If none of that resolves it, the issue may be at the hosting level — resource limits, server configuration, or something that requires a conversation with the hosting provider's technical support.
The process isn't necessarily complicated for someone who knows what they're doing, but it does require the right access and the ability to read what the errors are actually telling you. This is one of those repairs where guessing and clicking around can make things worse, especially if you're dealing with a corrupted database where a wrong move could mean data loss. If your site recently broke after some kind of change, our article on website broke after I changed something is also worth a read.
Signs This Is Your Issue
Not sure if the WordPress error establishing a database connection is what you're dealing with? Here's what to look for:
- Your site shows the exact message: "Error establishing a database connection"
- Your WordPress admin login page (yourdomain.com/wp-admin) shows the same error or a slightly different one saying "One or more database tables are unavailable"
- The site was working fine until a recent update, hosting change, or migration
- Your hosting provider recently made changes to their servers or you renewed your hosting plan
- A plugin or WordPress core update ran right before the site went down
If the admin panel is also down and not just the front end, that's a particularly strong sign the database itself is the problem — not just a display or theme issue.
Should You Try to Fix It Yourself?
Here's an honest answer: it depends on how comfortable you are with tools like FTP clients, cPanel, phpMyAdmin, and editing configuration files directly. If those words mean nothing to you, this is a repair best handed off.
The stakes are also higher than they might seem. Your database contains everything — every blog post, every customer record, every product, every page. Incorrect repairs can corrupt it further or wipe data you can't easily recover. Most people in this situation aren't lacking intelligence; they're lacking the specific technical context to know what's safe to do and what isn't.
If you do want to try, the safest first step is checking with your hosting provider. Many will tell you quickly if their database server is having issues (which is their problem to fix, not yours). Beyond that, proceed with caution.
For most business owners, the better move is getting someone who does this regularly to handle it quickly. You have a business to run, and the longer this sits, the more it costs you — not just in lost traffic, but in SEO rankings that can slip when Google can't reach your site. If you're weighing your options on cost, how much does it cost to fix a website breaks down what you can realistically expect to pay.
Common Questions About WordPress Error Establishing Database Connection
How long does it take to fix a WordPress database connection error? In straightforward cases — like wrong credentials or a hosting server that just needed a restart — the fix can take under an hour. If the database is corrupted or the issue requires restoring from a backup, it could take a few hours. The biggest variable is how quickly someone with the right access can dig into the problem.
Will I lose my website content if the database has to be repaired? Not necessarily. Most database repairs are non-destructive, meaning the data stays intact. However, if the database is severely corrupted and needs to be restored from a backup, you could lose content created after that backup was taken. This is why having recent backups matters — and why you should ask any repair provider whether they'll back up before touching anything.
Can a plugin cause the WordPress error establishing database connection? Yes. A misbehaving or poorly coded plugin can overwhelm your database with too many requests, trigger a crash, or — in rare cases — corrupt database tables during an update. If the error appeared right after installing or updating a plugin, that's a strong clue. Related issues like a WordPress white screen of death can also be triggered by the same culprits.
Is this error always a sign of something serious? Not always. Sometimes it's as simple as your hosting provider having a temporary outage that resolves on its own within minutes. Other times it points to a more persistent issue like corrupted tables or misconfigured credentials. The safest move is to check your hosting provider's status page first, and if the issue persists beyond an hour, treat it as something that needs attention.
Can this error affect my Google ranking? It can, if the site stays down long enough. Google crawls your site periodically, and if it repeatedly finds the database error, it may drop your pages in rankings. A short outage (a few hours) usually doesn't cause lasting damage, but a site that's been down for days is a different story. The sooner you get it fixed, the less SEO impact you'll see.
The Faster Path
If you've read through this and your main thought is "I just want someone to fix it" — that's completely reasonable. This is a technical problem that affects a business-critical tool, and there's nothing wrong with treating it that way.
Rune is a flat-rate website repair service built specifically for situations like this one. You describe what's happening, get a clear price upfront, and a real developer digs in and fixes it. No hourly billing surprises, no waiting days for a quote, no explaining yourself to a generalist who isn't sure where to start.
The WordPress error establishing a database connection is one of the repairs we handle regularly. Whether it's a credentials issue, a corrupted table, or something the hosting provider needs to sort out on their end — we know how to trace it down and get your site back up. If you're not sure whether your situation needs help or just needs time, you can also check out our guide to my website is broken and I don't know what to do for a clear starting point.
Head over to runeintel.com to tell us what's going on. Most repairs are underway the same day.