How to repair tables after a MySQL crash

Sometimes MySQL crashes. The most usual caise is a hard disk getting full.

When that happens, you will have database tables marked as crashed and Asternic won't work correctly (or it will not update data), even after you make room on your hard disk again.

To find out if some your tables are marked as crashed you can run these commands:

mysql -u root -p qstats -e "select * from queue_stats limit 10"
mysql -u root -p qstats -e "select * from queue_stats_mv limit 10"
mysql -u root -p qstats -e "select * from recordings limit 10"

If any of those returns an error saying that the table is marked as "crashed", then you must repair them with the following commands:

mysql -u root -p qstats -e "repair table queue_stats"
mysql -u root -p qstats -e "repair table queue_stats_mv"
mysql -u root -p qstats -e "repair table recordings"
Please note that the "recordings" table is part of CCStats PRO only. No such table exists on the Lite version.

After repairing the tables, start the log parser service:

service asterniclog start

Did you find this article useful?