• in MyISAM due to engine / server crashes
  • InnoDB should NOT corrupt tables! If so, it is probably HW problem mainly with disk!
  • CHECK TABLE – checks if table is corrupted
  • Repair (all engines):
    • REPAIR TABLE
    • ALTER TABLE xxxxx ENGINE=<the_same_engine>
    • dump and restore
  • Repait (MyISAM) – myisamchk
  • in some cases repair is not possible and we have to restore backup or try to recover corrupted files
  • data fragmentation:
    • OPTIMIZE TABLE
    • ALTER TABLE without param.
    • dump and restore