HOW DO I FIX AN ERROR ESTABLISHING DATABASE CONNECTION?


#1

INSTRUCTIONS
This error is caused by the database’s inability to access the information in the database. Use the following troubleshooting steps to resolve the most common causes of this issue.

Before Starting
There are a few areas of your DV server you may want to check before updating the wp-config.php file.

  1. Check your disk space. If you are above 90% disk usage this can cause various errors on your server/site.
  2. Try rebooting your server. This can occasionally help clear out various errors or rogue process that may have developed.

Verifying the wp-config.php file
Should the above options not resolve the issue, you can continue troubleshooting by attempting to check/update the wp-config.php file which should be located in your domain’s root directory. These can be edited through your domain’s File Manager, FTP, or SSH.

pleskdb-1.png

Verify that the information is correct:

Database name: This is the name of the database that WordPress connects to. For 1-click installs, this is automatically configured and should be correct unless you have made changes. If you are unsure of what the proper database name is, do the following:
Log in to phpMyAdmin.
Select a WordPress database and then identify the _wpoptions table.
Click on the _wpoptions table to list its contents using the Browse tab. This table should include the site URL and home. If this value matches the address of your WordPress site, this is likely the proper database.
Database Username: The database username may be set properly in wp-config.php, but the assigned user does not have permission access to the database. Make sure that the database username is set to a user that has permission to access to the database. This is more likely to be an issue if you have recently migrated a WordPress site from a different location and did not create the database user or give the user proper permissions.
Database Password: If you are unsure of the database password, reset the database user’s password, and then use that new value for the database password field.
Database Hostname: The database hostname is the address of the database server. Unless you are connecting to an external database, the database hostname should be set to ‘localhost:3306’. This will work fine and can be left in place.