tags:

views:

567

answers:

4

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.

+5  A: 

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

Deniz Dogan
+1  A: 

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 ...

ChristopheD
... or well implemented database layers
Fire Crow
+2  A: 

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 ;)

Thinker
+3  A: 

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.

rpSetzer
How do you do that?
Jeff Davis