The Error to Establish Database Connection error can occur because of multiple reasons; however, it is usually because, either your configuration files are referencing the wrong database or your website isn’t able to connect to the correct database. For WordPress sites, the most common cause is the misconfiguration of the wp-config. php file.
Fixing the Error to Establish Database Connection Error
The first step to fixing the error is restoring your website to a previous healthy point. Log into your 10Web dashboard, click on the site with the error to restore your site.
The login credentials for your FTP client are located in the 10Web dashboard under Hosting Services > Credentials.
Use the credentials in your SFTP field box to log into FileZilla.
Click on web/wp-live, the WordPress root directory, then right click on wp-config.php and choose View/Edit.
Under MySQL settings, check that the database name (DB_NAME) , DB username (DB_USER), and DB Password (DB_PASSWORD) are defined correctly. If they’re not, change them manually and Save.
You can find the credentials of your DB Name, Username, and Password in the 10Web dashboard under Hosting Services > Credentials > Database Access field box.
If this does not fix the issue, we welcome you to contact our Customer Care team.