This quick guide will take you through the steps to fix the “Error establishing a database connection” error for WordPress in cPanel. 

 

 

 

1.  Log in to cPanel. 

 

2. Click on “MySQL Databases”. 


 

 

3. Scroll down to the “Current Users” section and click on “Change Password”. 


 

 

4. Enter a password you would like to use or use the password generator for a more secure password. 


 

 

5. Click on “Change Password” to save. 


 

 

6. Go back to cPanel’s homepage. 


 

 

7. Click on “File manager”. 


 

 

8. Open the “public_html” folder. 


 

 

9. Right-click on the “wp-config” file and click on “Edit”. 


 

 

10. Update the password next to “DB_PASSWORD”. 


 

 

11. You’ll notice that the current password starts and ends with an apostrophe sign (‘). If your password is ThisIsAnExample23, then the password in the file needs to look like: 

‘ThisIsAnExample23’ 


 

 

12. Click on “Save Changes” at the top. 


 

 

Test your website to see if it works. If notplease advise us so that we can look into the issue.