What causes MyISAM to become corrupt? [closed]

巧了我就是萌 提交于 2019-12-06 05:26:23

问题


I've heard that MyISAM tables can become corrupt, what sort of actions are most likely to corrupt them and how can you safely fix said corruptions.


回答1:


The MySQL documentation is quite explicit about that: http://dev.mysql.com/doc/refman/5.1/en/corrupted-myisam-tables.html




回答2:


I have a production server and in case of cold resets(e.g. power failures) all MyISAM tables that were in an update process get corrupted. mysqlcheck solves the problem. I recommend putting mysqlcheck with the --auto-repair option in a cron, to fix the rare cases of corruption that happen at runtime.




回答3:


I got MyISAM corruption sometimes. On my server problem is very heavy load that can overwhelm MySQL causing it to hang. That what happens in real world ;)




回答4:


Another problem with MyISAM (although not really database corruption in the strict sense) is that it does not properly support transactions (commit - rollback).

This could also potentially lead to data integrity problems sooner or later (depending on the quality of the implementation of your database layer).

In my opinion this makes the 'fast' MyISAM backend in MySQL only an option for really simple or really small databases ...




回答5:


To my knowledge, I see that power failure or sudden failure in syncing leads to corruption of Myisam data.

Switching to innodb would be the best choice here.



来源:https://stackoverflow.com/questions/739958/what-causes-myisam-to-become-corrupt

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!