top of page



TABLE tbl_name [, tbl_name] ...

REPAIR TABLE repairs a possibly corrupted table, for certain storage
engines only.

This statement requires SELECT and INSERT privileges for the table.

Although normally you should never have to run REPAIR TABLE, if
disaster strikes, this statement is very likely to get back all your
data from a MyISAM table. If your tables become corrupted often, try to
find the reason for it, to eliminate the need to use REPAIR TABLE. See, and

REPAIR TABLE checks the table to see whether an upgrade is required. If
so, it performs the upgrade, following the same rules as CHECK TABLE
... FOR UPGRADE. See [HELP CHECK TABLE], for more information.


o Make a backup of a table before performing a table repair operation;
under some circumstances the operation might cause data loss.
Possible causes include but are not limited to file system errors.

o If the server exits during a REPAIR TABLE operation, it is essential
after restarting it that you immediately execute another REPAIR TABLE
statement for the table before performing any other operations on it.
In the worst case, you might have a new clean index file without
information about the data file, and then the next operation you
perform could overwrite the data file. This is an unlikely but
possible scenario that underscores the value of making a backup

o In the event that a table on the source becomes corrupted and you run
REPAIR TABLE on it, any resulting changes to the original table are
not propagated to replicas.



bottom of page