Yesterday, a ticket came in where a student’s website was not establishing a database connection. I started my usual checks to see what kind of installation she had on her domain. In this case it was a WordPress installation. I went to double check that the username and password in the wp-config.php file was the same as the wp-options table in phpMyAdmin. After trying to open the wp-options I received an error similar to this:
mysql> select * from nagios_servicechecks;
ERROR 1194 (HY000): Table ‘nagios_servicechecks’ is marked as crashed and should be repaired
This error can say a wide range of things, but this fix works when it says that the table should be repaired.
**Note, this error was not what I was working on it’s definitely similar though. I didn’t grab a screenshot of it before fixing the error**
To fix this first click the checkbox next to the table you’d like to repair. Then click the ‘With Selected’ dropdown box.
Once that’s done, click ‘Go’ on the bottom right of the screen.
Once complete you’ll see this.
Double check that the site loads now. If you’re still getting the “Error Establishing Database Connection” try refreshing your browser cache or load the site from your phone with the Wi-Fi turned off.