Whenever a table crashes, MySQL returns as error: Table xxx crashed. Please repair the table.
Now I was wondering, what will happen if I repair a table that is healthy? Will it be ignored? Can I damage the table?
Reason: In the past days different tables have crashed and I'm considering issuing a repair on all tables as preventive measure.
Best Answer
Prevention: Use
ENGINE=InnoDB
instead of MyISAM. Innodb is self-repairing.Damage: No.
REPAIR TABLE
is safe. However, the standard practice is first doCHECK TABLE
. Then, if that says to, runREPAIR TABLE
.