You may encounter a database error when accessing your WordPress website. Here are the common reasons why you are getting the error establishing a database connection message:
- wrong database password
- wrong database name
- wrong database username
How to fix error establishing a database connection?
Step 1. Log in to your cPanel.
Step 2. For cPanel, click File Manager under Files panel.
Step 3. Locate WordPress directory.
Step 4. Click on wp-config.php.
Step 5. Click on Code Editor.
Step 6. Read the guidelines and click Edit button.
Step 7. In the editor page, locate the database name, username and password.
Check the database credentials and make sure all are correct. Modify all the necessary credentials and update it.
Step 8. Click Save Changes button located at the upper right hand corner of the page.
Step 1. Access FTP.
Step 2. Locate WordPress directory.
Step 3. Click on wp-config.php and download.
Step 4. Access the file via editor.
Step 5. Locate the database name, username and password.
/** The name of the database for WordPress */
/** MySQL database username */
/** MySQL database password */
Step 6. Save the wp-config.php file and upload it into your WordPress directory. You may need to overwrite the existing wp-config file.
Do not hesitate to contact our support team if you have further questions.