On the local test machine the day before yesterday, data loss occurs when MySQL 5.1.43 and MyISAM engines run repair table. We hereby record that the same problem has been encountered in MySQL 5.0.32, therefore, you must back up the data before repair table.
The night before executing repair table, I just watched the movie "astronaut's wife". Although it was a bad film, I was very impressed with one sentence: "The Space Agency told me, there must be backups. "outsiders know the simple truth, but I didn't do it. Remember this.
This is also a bug officially recognized by MySQL,
Http://bugs.mysql.com/bug.php? Id = 1, 10437,
Http://bugs.mysql.com/bug.php? Id = 1804
MySQL Manual also pointed out:
Mysql5.0 and mysql5.1,
How can we avoid the same problem?
UseMyisamchk
-- Safe-recover
Another cool-man recommended me: optimize local table tablename. The benefit of this command is that it works for both MyISAM and InnoDB.
After testing that the MyISAM table is damaged, optimize local table tablename cannot be repaired or usedMyisamchk
-- Safe-recoverOf course, do not forget the backup!