If MySQL crashed (for example if the computer is turned off) when all data is not written to disk the tables may have become corrupted. To check a table use:
isamchk table_name
isamchk -e table_name
isamchk -e -i table_name
We at TcX run a cron job on all our important tables once a week.
35 0 * * 0 /path/to/isamchk -s /path/to/dbs/*/*.ISM
This prints out any crashed tables so we can go and examine and repair them when needed.
As we haven't had any unexpected crashes (without hardware trouble) tables for a couple of years now (this is really true), once a week is more than enough for us.
Of course, whenever the machine has done a reboot in the middle of a update one usually has to check all the tables that could have been affected. (This is an 'expected crashed table')
We recommend that to start with, one should do a isamchk -s on all
updated tables each night until one comes to trust MySQL as much
as we do.
Naturally, one could add a check to safe_mysql that, if there is an old pid file left after a reboot, it should check all tables that have been modified the last 24 hours.
Go to the first, previous, next, last section, table of contents.