How to Fix “Error Establishing a Database Connection” in WordPress

Troubleshooting 1 min read Updated Oct 30, 2026

This WordPress message means your site can’t log in to its database. It is usually caused by incorrect details after a move or password change.

Work through these checks

  1. Check wp-config.php. In File Manager, open public_html/wp-config.php and confirm DB_NAME, DB_USER, DB_PASSWORD and DB_HOST (normally localhost) match your database exactly, including the username prefix.
  2. Reset the database password. In Account Manager › MySQL Management, select the database, change the user’s password, and paste the new one into wp-config.php.
  3. Check the user is attached. The database user must be assigned to the database in MySQL Management.
  4. Check disk space. A full account can stop the database working. See Disk quota exceeded.

Frequently asked questions

Can a hacked site cause this error?

It can, if wp-config.php was altered. If your details look wrong and you didn’t change them, change all passwords and contact support.

Related articles

Still need help?

Our support team is here for you.

Email: support@crowncityhost.com

Open a ticket