Error Establishing a Database Connection in WordPress

myMO IT Solutions

Why do you get this error?

You are getting this error because WordPress is not able to connect with database. There can be multiple reasons for it. Following below steps will solve it for 95% times. For other please feel free to brain storm with us.

1. DB credentials are incorrect

Check database credentials in wp-config.php. Check for typo error.

2. Database table is corrupt

If you are getting this error on front page, you must check the backend ( In most cases, it is a corrupt db problem. Add a line in wp-config define('WP_ALLOW_REPAIR', true); 

Now again access backend ( Select repair Database


If you get the result as certain table cannot be repaired. You should visit phpMyAdmin in cpanel and repair particular table from operation tab.


Comment Here