Fixing "Error establishing a database connection"
WordPress can't reach its database; here's how to find out why.
WordPress reads its database details from the wp-config.php file. This error means those details are wrong, or the database isn't reachable.
- In File Manager, open
wp-config.phpand noteDB_NAME,DB_USERandDB_PASSWORD.DB_HOSTshould belocalhoston IDX hosting. - In cPanel Manage My Databases, check that the database and the user exist with exactly those names (including the prefix), and that the user is added to the database with all privileges.
- If unsure of the password, set a new one for the database user in cPanel and put the same one in
wp-config.php. - Just moved the site? Make sure you imported the database.
If the details are all right and the error continues, open a ticket to the WordPress department.