Hosting FAQ

How to resolve: check_mysql has determined that there are corrupted database tables (eximstats)

Did you get the following message/alert from cpanel?

check_mysql has determined that there are corrupted database tables

mysql-eximstats-crash

First, you want to rule out that you’re not having serious server issues like a failing HD (test with smartctl) or OS/kernel crashes (review OS logs). To see the exact database causing the issue you will want to review the mysql log. On a cpanel server, this will be found in /var/lib/mysql/.err. The most common issue is the eximstats database that can start corrupting from an abrupt restart or crash (which is more common as it gets bigger).

The error you’re looking for will look something like this:

2016-03-15 17:14:26 30634 [ERROR] /usr/sbin/mysqld: Table ‘./eximstats/failures’ is marked as crashed and should be repaired

If you see anything related to /eximstats/ you can repair the database/table or simple drop it and re-create it with the below command:

mysqladmin drop eximstats
mysqladmin create eximstats
mysql eximstats < /usr/local/cpanel/etc/eximstats_db.sql

Alternatevly, you can also do it from the mysql interface like this:

mysql
mysql> use eximstats
mysql> delete from sends;
mysql> delete from smtp;
mysql> delete from failures;
mysql> delete from defers;

Once done, restart mysql (with something like: service mysql restart) and you should be all set.