mysqlcheck
checks, repairs, and optimizes MySQL tables
TLDR
Check all tables in database
$ mysqlcheck -u [user] -p [database]
Check all databasescopy
$ mysqlcheck -u [user] -p --all-databases
Repair tablescopy
$ mysqlcheck -u [user] -p --repair [database]
Optimize tablescopy
$ mysqlcheck -u [user] -p --optimize [database]
Analyze tablescopy
$ mysqlcheck -u [user] -p --analyze [database]
Check specific tablecopy
$ mysqlcheck -u [user] -p [database] [table]
Auto repaircopy
$ mysqlcheck -u [user] -p --auto-repair [database]
copy
SYNOPSIS
mysqlcheck [options] [database] [tables]
DESCRIPTION
mysqlcheck checks, repairs, and optimizes MySQL tables. It maintains database integrity.The tool runs CHECK, REPAIR, ANALYZE, and OPTIMIZE. Essential for database maintenance.
PARAMETERS
DATABASE
Database name.TABLES
Specific tables to check.--all-databases
Check all databases.--repair
Repair corrupted tables.--optimize
Optimize tables.--analyze
Analyze tables.--auto-repair
Auto repair issues.--help
Display help information.
CAVEATS
May lock tables. Backup before repair. Some engines don't support all operations.
HISTORY
mysqlcheck is part of the MySQL distribution for table maintenance and repair operations.
SEE ALSO
mysql(1), mysqladmin(1), mysqldump(1)