MySQL Corrupt Tables and How to Avoid it
Once in a while MySQL's tables became corrupted. This post is not interested in repair process (you should see other posts, but the most general advice is to do a REPAIR TABLE table ; ) In my humble opinion, a real life production database must not have any corruption, it must have sufficient failsafe mechanisms to avoid such corruption. Causes of Corruption MyISAM tables could became corrupted by (refer http://dev.mysql.com/doc/refman/5.1/en/corrupted-myisam-tables.html) : mysqld is being killed in the middle of write unexpected computer shutdown occured hardware failures running an external program (example: myisamchk) while mysqld is running software bug in Mysql/myISAM code Tips to mitigate data corruption Do not use MyISAM for long lasting data. Use InnoDB. InnoDB is less corruption prone than MyISAM. Use file per table option for InnoDB. Check your disk space and database availability periodically. On one occasion, my mysql data partition is full...