Reasons for the Error establishing a database connection message
In some cases, this error may be temporary due to something tying up the database. Other possible causes are:
- Missing or incorrect database username -- your credentials must be correct to connect to the database.
- Incorrect database user password -- Update the password for your user to match your scripting.
- In the cPanel Database module, go to MySQL Databases.
- In the Current Users section, click Change Password next to the user and set it to match the password in your scripts.
- User not assigned to the database -- The user must be assigned to the database for it to be able to connect.
- User not assigned the correct privileges -- The user must be assigned the correct privileges for database communication. Review and update the user privileges to ensure that all of the privileges that it needs for your scripts are set.
- Old version of PHP -- Having your account set to an old version of PHP may cause connection errors. You may need to update PHP to a newer version.
- For best compatibility, we currently recommend PHP 7.4 (ea-php74).
- Outdated or incompatible software -- An outdated version of WordPress can cause errors. You may need to upgrade WordPress to a more recent version.
- Repair the database tables -- Unreadable table data can cause issues with the database being unresponsive.
Still receiving this message and can't resolve the issue? Contact customer care. We're happy to help!