Here is what you should do if a table crashes and auto repair after mysql restart fails.
- Open a terminal / command line utility
- If crash is on remote server you will need to ssh first
- service mysql stop
- cd /var/lib/mysql/{your database name}
- myisamchk -r {table name}
– recovering (with sort) MyISAM-table ‘{table name}’
Data records: 1686809
myisamchk: error: Can’t create new tempfile: ‘{table name}.TMD’
MyISAM-table ‘{table name}’ is not fixed because of errors
Try fixing it by using the –safe-recover (-o), the –force (-f) option or by not using the –quick (-q) flag
- myisamchk -r -v -f {table name}
– recovering (with sort) MyISAM-table ‘{table name}’
Data records: 1686809
– Fixing index 1
– Searching for keys, allocating buffer for 9434 keys
– Merging 1686809 keys
– Last merge and dumping keys
– Fixing index 2
– Searching for keys, allocating buffer for 30801 keys
– Merging 1686809 keys
– Last merge and dumping keys
- service mysql start
Hope this helps