Options for mariadb-check & mysqlcheck in MariaDB Enterprise Server 10.6


The mariadb-check utility is the newer name for mysqlcheck, though you can still run it using either name.



--all-databases (-A)

Check all the databases. This is the same as --databases with all databases selected.

--all-in-1 (-1)

Instead of issuing one query for each table, use one query per database, naming all tables in the database in a comma-separated list.

--analyze (-a)

Analyze given tables.


If a checked table is corrupted, automatically fix it. Repairing will be done after all tables have been checked, if corrupted ones were found.


Directory for character set files.

--check (-c)

Check table for errors.

--check-only-changed (-C)

Check only tables that have changed since last check or haven't been closed properly.

--check-upgrade (-g)

Check tables for version-dependent changes. May be used with --auto-repair to correct tables requiring version-dependent updates.


Use compression in server/client protocol.

--databases (-B)

Check several databases. Note the difference in usage; in this case no tables are given. All name arguments are regarded as database names.

--debug (-#)

This is a non-debug version. Catch this and exit.


Check memory and open file usage at exit.


Print some debug info at exit.


Default authentication client-side plugin to use.


Set the default character set.


Read this file after the global files are read.


Only read default options from the given file #.


Additionally read default groups with # appended as a suffix.

--extended (-e)

If you are using this option with CHECK TABLE, it will ensure that the table is 100 percent consistent, but will take a long time. If you are using this option with REPAIR TABLE, it will force using old slow repair with keycache method, instead of much faster repair by sorting.

--fast (-F)

Check only tables that haven't been closed properly.


Fix database names.


Fix table names.


Flush each table after check. This is useful if you don't want to have the checked tables take up space in the caches after the check

--force (-f)

Continue even if we get an SQL error.

--help (-?)

Display this help message and exit.

--host (-h)

Connect to host.

--medium-check (-m)

Faster than extended-check, but only finds 99.99 percent of all errors. Should be good enough for most cases.


Don't read default options from any option file.

--optimize (-o)

Optimize table.

--password (-p)

Password to use when connecting to server. If password is not given, it's solicited on the tty.

--persistent (-Z)

When using ANALYZE TABLE use the PERSISTENT FOR ALL option.


Directory for client-side plugins.

--port (-P)

Port number to use for connection or 0 for default to, in order of preference, my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default (3306).


Print the program argument list and exit.


Perform the requested operation on tables. (Defaults to on; use --skip-process-tables to disable.)


Perform the requested operation (check or repair) on views. One of: NO, YES (correct the checksum, if necessary, add the mariadb-version field), UPGRADE (run from mariadb-upgrade), UPGRADE_FROM_MYSQL (same as YES and toggle the algorithm MERGE<->TEMPTABLE.


The protocol to use for connection (tcp, socket, pipe).

--quick (-q)

If you are using this option with CHECK TABLE, it prevents the check from scanning the rows to check for wrong links. This is the fastest check. If you are using this option with REPAIR TABLE, it will try to repair only the index tree. This is the fastest repair method for a table.

--repair (-r)

Can fix almost anything except unique keys that aren't unique.

--silent (-s)

Print only error messages.


Don't process the database specified as argument

--socket (-S)

The socket file to use for connection.


Enable SSL for connection (automatically enabled with other flags).


CA file in PEM format (check OpenSSL docs, implies --ssl).


CA directory (check OpenSSL docs, implies --ssl).


X509 cert in PEM format (implies --ssl).


SSL cipher to use (implies --ssl).


Certificate revocation list (implies --ssl).


Certificate revocation list path (implies --ssl).


X509 key in PEM format (implies --ssl).


Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default.


Overrides option --databases (-B).


TLS protocol version for secure connection.


When used with REPAIR, get table structure from .frm file, so the table can be repaired even if .MYI header is corrupted.

--user (-u)

User for login if not current user.

--verbose (-v)

Print info about the various stages; Using it 3 times will print out all CHECK, RENAME and ALTER TABLE during the check phase.

--version (-V)

Output version information and exit.


Log ANALYZE, OPTIMIZE and REPAIR TABLE commands. Use --skip-write-binlog when commands should not be sent to replication slaves. (Defaults to on; use --skip-write-binlog to disable.)