myisamchk其他用法
注意:使用myisamchk前,要确保mysqld没有在访问要检查的表。最好停止mysqld。
1 执行myisamchk –update-state -s *.myi,检查有哪些索引文件出了问题(可能会化费比较长的时间)。
update-state选项只有在停止mysqld的时候使用,-s表示忽略一些正常的表列出的信息,只列出错误。
2 对于每一个损坏的表,尝试myisamchk -r -q table_name。这是快速修复模式,会自动检查索引表和数据表是否能够一致。如果一致,则可以修复。
3 如果快速修复模式失败,考虑:myisamchk -r table_name,会删除不一致的数据和索引,并重新构建索引。
4 如果3失败,考虑:myisamchk –safe-recover table_name
如果上述的措施都失败了,不要苦!还有点希望,看mysql manual怎么说:
Stage 3: Difficult repair
You should reach this stage only if the first 16KB block in the index file is destroyed or contains incorrect information, or if the index file is missing. In this case, it’s necessary to create a new [...]
阅读完整的文章... admin on 05月 29th, 2007 | File Under MySQL维护 | No Comments -