mysqlcorruption

MySQL Corruption After Graceful Restart


Has anyone ever encountered MySQL corruption after performing a graceful server reboot?

Just worries me because I have never had that happen before. What could be the causes?


Solution

  • Index changes to MyISAM tables are not immediately flushed to disk for performance reasons. If your MySQL server is killed before the indexes are completely flushed to disk, then there is an inconsistency between the data (which is flushed asap) and the indexes. In this case, myisamchk in repair mode can fix the indexes (which is pretty much the same as REPAIR table, but is more flexible in the amount of memory it uses and hence its speed).