1. online
Check table tablename
repair table tablename
2. offline
- Check all myisam table in particular database
shell> myisamchk *.MYI
- Check all myisma table in all database
shell> myisamchk /path/to/datadir/*/*.MYI
- Check and repair all myisam table
If you want to check all MyISAM tables and repair any that are corrupted, you can use the following command:
shell> myisamchk --silent --force --fast --update-state \
--key_buffer_size=64M --sort_buffer_size=64M \
--read_buffer_size=1M --write_buffer_size=1M \
/path/to/datadir/*/*.MYI
Reference
myisamchk — MyISAM Table-Maintenance Utility
Checking Tables with mysqlcheck and myisamchk
How to Repair Tables
No comments:
Post a Comment