mysqlheck [option] db_name [tables]

-c --check(检查表)

-r  --repair(修复表)

-a  --analyze(分析表)

-o  --optimize(检查表)

[root@node01 sakila]# mysqlcheck -S /tmp/mysql3306.sock -uroot -p -c qq
Enter password:
qq.book OK
qq.comps_test1 OK
qq.comps_test2 OK
qq.course OK
qq.course2 OK
qq.gen OK
qq.myisam_char OK
qq.mytest OK
qq.qt OK
qq.rc1 OK
qq.t OK
qq.t1 OK
qq.t2 OK
qq.t5 OK
qq.t6 OK
qq.t_ai_1 OK
qq.t_lock_1 OK
qq.t_lock_2 OK
qq.t_lock_4 OK
qq.t_lock_8 OK
qq.tcv OK
qq.teacher OK
qq.teacher2 OK
qq.teacherCard OK
qq.test01 OK
qq.test_bin_1 OK
qq.test_heap OK
qq.test_index_1 OK
qq.test_rc OK
qq.test_xa_1 OK
qq.tid OK
qq.trans_test_1 OK
qq.trans_test_2 OK
qq.ts OK
qq.tt OK
qq.tt4 OK
qq.tt5 OK
qq.tx OK
qq.userinfo OK
[root@node01 sakila]# mysqlcheck -S /tmp/mysql3306.sock -uroot -p -r qq
Enter password:
qq.book
note : The storage engine for the table doesn't support repair
qq.comps_test1
note : The storage engine for the table doesn't support repair
qq.comps_test2
note : The storage engine for the table doesn't support repair
qq.course
note : The storage engine for the table doesn't support repair
qq.course2
note : The storage engine for the table doesn't support repair
qq.gen
note : The storage engine for the table doesn't support repair
qq.myisam_char OK
qq.mytest
note : The storage engine for the table doesn't support repair
qq.qt
note : The storage engine for the table doesn't support repair
qq.rc1 OK
qq.t
note : The storage engine for the table doesn't support repair
qq.t1
note : The storage engine for the table doesn't support repair
qq.t2
note : The storage engine for the table doesn't support repair
qq.t5
note : The storage engine for the table doesn't support repair
qq.t6
note : The storage engine for the table doesn't support repair
qq.t_ai_1
note : The storage engine for the table doesn't support repair
qq.t_lock_1
note : The storage engine for the table doesn't support repair
qq.t_lock_2
note : The storage engine for the table doesn't support repair
qq.t_lock_4
note : The storage engine for the table doesn't support repair
qq.t_lock_8
note : The storage engine for the table doesn't support repair
qq.tcv
note : The storage engine for the table doesn't support repair
qq.teacher
note : The storage engine for the table doesn't support repair
qq.teacher2
note : The storage engine for the table doesn't support repair
qq.teacherCard
note : The storage engine for the table doesn't support repair
qq.test01
note : The storage engine for the table doesn't support repair
qq.test_bin_1
note : The storage engine for the table doesn't support repair
qq.test_heap
note : The storage engine for the table doesn't support repair
qq.test_index_1
note : The storage engine for the table doesn't support repair
qq.test_rc
note : The storage engine for the table doesn't support repair
qq.test_xa_1
note : The storage engine for the table doesn't support repair
qq.tid
note : The storage engine for the table doesn't support repair
qq.trans_test_1
note : The storage engine for the table doesn't support repair
qq.trans_test_2
note : The storage engine for the table doesn't support repair
qq.ts
note : The storage engine for the table doesn't support repair
qq.tt
note : The storage engine for the table doesn't support repair
qq.tt4
note : The storage engine for the table doesn't support repair
qq.tt5
note : The storage engine for the table doesn't support repair
qq.tx
note : The storage engine for the table doesn't support repair
qq.userinfo
note : The storage engine for the table doesn't support repair
[root@node01 sakila]# mysqlcheck -S /tmp/mysql3306.sock -uroot -p -a qq
Enter password:
qq.book OK
qq.comps_test1 OK
qq.comps_test2 OK
qq.course OK
qq.course2 OK
qq.gen OK
qq.myisam_char OK
qq.mytest OK
qq.qt OK
qq.rc1 OK
qq.t OK
qq.t1 OK
qq.t2 OK
qq.t5 OK
qq.t6 OK
qq.t_ai_1 OK
qq.t_lock_1 OK
qq.t_lock_2 OK
qq.t_lock_4 OK
qq.t_lock_8 OK
qq.tcv OK
qq.teacher OK
qq.teacher2 OK
qq.teacherCard OK
qq.test01 OK
qq.test_bin_1 OK
qq.test_heap OK
qq.test_index_1 OK
qq.test_rc OK
qq.test_xa_1 OK
qq.tid OK
qq.trans_test_1 OK
qq.trans_test_2 OK
qq.ts OK
qq.tt OK
qq.tt4 OK
qq.tt5 OK
qq.tx OK
qq.userinfo OK
[root@node01 sakila]# mysqlcheck -S /tmp/mysql3306.sock -uroot -p -o qq
Enter password:
qq.book
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.comps_test1
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.comps_test2
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.course
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.course2
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.gen
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.myisam_char OK
qq.mytest
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.qt
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.rc1
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.t
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.t1
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.t2
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.t5
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.t6
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.t_ai_1
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.t_lock_1
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.t_lock_2
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.t_lock_4
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.t_lock_8
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.tcv
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.teacher
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.teacher2
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.teacherCard
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.test01
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.test_bin_1
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.test_heap
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.test_index_1
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.test_rc
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.test_xa_1
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.tid
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.trans_test_1
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.trans_test_2
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.ts
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.tt
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.tt4
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.tt5
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.tx
note : Table does not support optimize, doing recreate + analyze instead
status : OK
qq.userinfo
note : Table does not support optimize, doing recreate + analyze instead
status : OK

05-06 10:35