Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Check and Repair MySQL Tables Using Mysqlcheck

Check and Repair MySQL Tables Using Mysqlcheck

Check a Specific Table in a Database

$ mysqlcheck -c database_name table_name -u root -p

Check All Tables in a Database

$ mysqlcheck -c database_name  -u root -p

Check All Tables and All Databases

All
$ mysqlcheck -c  -u root -p --all-databases
Specific list data_bases
$ mysqlcheck -c  -u root -p --databases database_name_1 database_name_2

Analyze Tables using Mysqlcheck

$ mysqlcheck -a database_name table_name -u root -p

Optimize Tables using Mysqlcheck

$ mysqlcheck -o database_name table_name -u root -p

Repair Tables using Mysqlcheck

$ mysqlcheck -r database_name table_name -u root -p

Combine Check, Optimize, and Repair Tables

All
$ mysqlcheck -u root -p --auto-repair -c -o --all-databases
Specific database
$ mysqlcheck -u root -p --auto-repair -c -o database_name

Mode debug

$ mysqlcheck --debug-info -u root -p ...

Source : http://www.thegeekstuff.com/2011/12/mysqlcheck/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.