Skip to main content

Command Palette

Search for a command to run...

How to Fix "Error Establishing a Database Connection" on WordPress

Updated
2 min readView as Markdown
How to Fix "Error Establishing a Database Connection" on WordPress

Few WordPress errors are as immediately panic-inducing as a completely white screen reading "Error Establishing a Database Connection" — your entire site down, visitors seeing nothing but an error message, and no obvious explanation of what actually broke.

Why it happens: This error almost always points to your website losing communication with its database, usually due to incorrect database credentials (often after a hosting migration), a corrupted database, or — very commonly — your hosting server simply running out of available database connections during high traffic, something budget shared hosting plans are particularly prone to under any real load.

The fix: First, verify your wp-config.php file still has the correct database name, username, password, and host — a common cause after switching hosts or plans, where credentials silently change without anyone updating the configuration file. If credentials are correct, the issue is likely server capacity, meaning your hosting simply can't handle simultaneous database connections during busier traffic periods.

This is where properly resourced dedicated hosting becomes genuinely important for sites experiencing regular traffic, since dedicated resources eliminate the connection limits that shared environments impose across multiple competing websites.

For sites still on shared plans experiencing this repeatedly, upgrading to reliable WordPress-optimised hosting built specifically to handle database demands efficiently is usually the actual long-term fix, rather than repeatedly restarting services as a temporary band-aid. If this error keeps recurring despite correct credentials, it's a strong signal your current hosting plan has simply outgrown your site's actual traffic needs.

2 views

More from this blog

T

Tech & Linux Hub

14 posts