WordPress says Error establishing a database connection

  • Home WordPress says Error establishing a database connection
WordPress says Error establishing a database connection

WordPress says Error establishing a database connection

November 16, 2026

WordPress shows "Error establishing a database connection" when the site cannot reach the database that holds the pages, posts, and settings. The public site and the dashboard both stop. Visitors do not see the homepage. You see one sentence on a white page.

This is not a plugin problem. WordPress prints that sentence before it loads plugins or the theme. Deactivating plugins, changing the theme, or deleting a maintenance file will not clear it.

Wait, then refresh

Give it a minute and open the site in a private window. Hosts restart database software, and a short outage clears itself. If the sentence is gone, you are done. Refreshing ten times in the same minute does not repair a connection that is still down.

See if the host is down

Open the host's control panel in another tab. If the panel will not load, or every site on the account shows the same sentence, the database service is down. That is a host problem. Call the host before you edit any files.

If the panel loads and the other sites on the account are fine, the connection details for this site are the part that does not match.

Match four lines in wp-config.php

Those details live in wp-config.php, in the same folder as wp-admin and wp-content. Four lines matter: the database name, the database user, the database password, and the database host. The host panel has a databases page with the same four facts. They have to match.

The usual mismatch is the database host, after a site is moved or restored. On many servers that value is the word localhost. On others it is a name the host assigned. Copy the host name from the panel into the DB_HOST line. Change that one line, save, and refresh a private window.

If the panel says the database password was changed, the password in the file is the old one. Put the current password from the panel into the file. Do not email that password, and do not paste it into a chat.

If the account is out of room

A full disk, or a database that has hit the host's size limit, can produce the same sentence. The panel usually says the account is over quota. Freeing old backups the host already replaced, or asking the host to raise the limit, is the fix. Do not delete wp-config.php, wp-content, or the database to make room.

If you are not sure which database belongs to this site, stop. A name copied from a different site on the same account points WordPress at the wrong data. Leave the file as it is and get someone who can match it to the database the site was using.

When to hand it to someone

Call if the host panel will not open, if the four lines already match and the sentence is still there, or if you cannot tell which database is yours. Computer Geek can put the connection back and confirm the site is serving the pages it had before the outage.

The phone is 905-426-1784. The page for a site that is down is the website troubleshooter.

To Make a Request For Further Information

TESTIMONIALS

What Our Clients
Are Saying About Us

Get a
Free Consultation


LATEST ARTICLES

See Our Latest
Blog Posts

WordPress says Error establishing a database connection
November 16, 2026

WordPress says Error esta

Your host is forcing a PHP upgrade. What to check first
November 14, 2026

Your host is forcing a PH

Intuit Mailchimp