MyISAM tables are very easily destroyed. Each table has header information that tracks how many open files the MyISAM table processes.
If mysqld crashes, any MyISAM table that had open file descriptors has never been able to reduce the number of file descriptors each time the file descriptor is closed. Thus, if a new file descriptor opens the MyISAM table (.MYD file), and mysqld detects a mismatch between the number of file processes, the MyISAM table is considered open, and the number of files processed by the MyISAM table is actually open, the table is declared broken.
There are four (4) methods for doing this:
METHOD # 1: Setting up automatic recovery of MyISAM
See my post https://dba.stackexchange.com/a/15079/877 on how to install this when rebooting MySQL (March 15, 2012)
METHOD # 2: use InnoDB instead of MyISAM
InnoDB has disaster recovery built into Engine Engine initialization. Myisam not
METHOD # 3: Use Aria instead of MyISAM
Aria - MyDam replacement for MariaDB replacement. It implements crash recovery mechanisms for individual tables.
METHOD # 4: Do not kill -9 on mysqld
If mysqld crashes, inadvertently, the header information for all open MyISAM tables will cause them to crash. Avoid manually killing mysqld.
source share