Name

mysqlcheck

Synopsis

mysqlcheck [options] database [table]

Use this to check and to repair MyISAM tables, as well as to optimize them. This utility is similar in use and purpose to myisamchk. Instead of working with the table files directly like myisamchk, though, this utility interacts with the MySQL server instead. It uses the ANALYZE TABLE, the CHECK TABLE, and REPAIRTABLE statements.

The name of the database containing the tables to check is given as the second argument to the utility. The table to check is given as the third argument. Additional tables may be given in a space-separated list. Here is a list of options that you can give and a brief explanation of each:

--all-databases, -A

Instructs the utility to check all databases.

--all-in-1, -1

Instructs the utility to execute all queries for all tables in each database in one statement rather than in separate queries for each table.

--analyze, -a

Has the utility analyze tables.

--auto-repair

Instructs the utility to automatically repair any corrupted tables found.

--character-sets-dir= path

Specifies the directory containing character sets.

--check, -c

Instructs the utility to check tables for errors.

--check-only-changed, -C

Has the utility check only tables that have changed since the last check, as well as tables that were not closed properly.

--compress

Instructs the utility to compress data passed between it and the server if supported.

--databases databases , -B databases

Specifies more than one database for checking. ...

Get MySQL in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.