“Error establishing a database connection”

When the site can’t connect to its database.

Troubleshooting ~1 min read Updated: 30.09.2026
  1. Check the database name, user and password in your config file (wp-config.php, config.php) — they must match the full names in DirectAdmin.
  2. The host value must be localhost.
  3. In DirectAdmin, check under MySQL Management that the user is attached to the database.
  4. If you’re not sure of the password, change the user’s password in DirectAdmin and update it in the config too.
  5. If everything is correct, check that your disk limit isn’t full.
If the problem continues, contact support and we’ll check the database service on the server.
Problem not solved?

Our team is here 24/7 — open a ticket or write to the AI Advisor.