I. Overview
The Mysqlcheck client tool can examine and repair MyISAM tables, and can also optimize and parse tables. In fact, it integrates the Check,repair,analyze,optimize functionality in the MySQL tool, does not support memory tables for check, and repair does not support INNODB tables. Mysqlcheck runs only when the database is running, which means that service operations are not stopped.
Here are three ways to call Mysqlcheck:
The following options are commonly used in option:
-C,--check |
Check table |
-R,--repair |
Repair table |
-A,--analyze |
Analysis table |
-O,--optimize |
Optimizing tables |
1.1 Checklist (check)
pwd/usr/local/mysql//usr/local/mysql/bin/mysqlcheck-uroot-p-C test
It's checked in the test library, and A is OK.
1.2 Repair table (repair)
[Email protected] data]#/usr/local/mysql/bin/mysqlcheck-uroot-p-R test
A new InnoDB Type B table was created in the test library, showing that table B does not support repair.
1.3 Analysis Table (analyze)
[[email protected] data]#/usr/local/mysql/bin/mysqlcheck-uroot-p-a test
1.4 Optimization Table (optimize)
[Email protected] data]#/usr/local/mysql/bin/mysqlcheck-uroot-p-o test
MySQL Development Advanced Article Series 34 Tool Mysqlcheck (MyISAM Table Maintenance tool)