How do I fix "Error establishing a database connection"? Print

  • 0

This means your site cannot reach its database. Work through these:

  1. Check credentials: confirm the database name, user, password, and host in your config (WordPress wp-config.php or .env) match what is in cPanel's MySQL Databases. Host should be localhost.
  2. Re-check the user: ensure the user is added to the database with ALL PRIVILEGES.
  3. Reset the password in cPanel and update your config to match.
  4. Repair the database via phpMyAdmin if it may be corrupted.

If credentials are correct and it still fails, the MySQL service may be overloaded or down. Open a ticket and we will check the server right away.


Was this answer helpful?

« Back