CHECK & REPAIR Table in MySQL
CHECK & REPAIR Table in MySQL
CHECK TABLE
Syntax:
CHECK TABLE tbl_name [, tbl_name] … [option] …
where option = {FOR UPGRADE | QUICK | FAST | MEDIUM | EXTENDED | CHANGED}
CHECK TABLE checks a table or tables for errors. CHECK TABLE works for MyISAM, InnoDB, and (as of MySQL 5.0.16)
ARCHIVE tables. For MyISAM tables, the key statistics are updated as well.
CHECK TABLE can also check views for problems, such as tables that are referenced in the view definition that no longer exist.
REPAIR TABLE
Syntax:
REPAIR [LOCAL | NO_WRITE_TO_BINLOG] TABLE
tbl_name [, tbl_name] … [QUICK] [EXTENDED] [USE_FRM]
REPAIR TABLE repairs a possibly corrupted table. By default, it has the same effect as myisamchk –recover tbl_name. REPAIR TABLE
works for MyISAM and for ARCHIVE tables.
This statement requires SELECT and INSERT privileges for the table.
