CHECK & REPAIR Table in MySQL

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.

Leave a Reply

You must be logged in to post a comment.


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.