mysqlcheck


mysqlcheck

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 REPAIR TABLE 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. To specify tables with this option, use the --tables option.


--debug[= options], -# [ options]

Instructs the utility to write debugging information to the log specified, along with various settings (e.g., 'd:t:o,logname').


--default-character-set= set

Specifies the default character set.


--extended, -e

Ensures consistency of data when checking tables. When repairing tables with this option, the utility will attempt to recover all rows, including intentionally deleted ones.


--fast, -F

Instructs the utility to check only tables that were improperly closed.


--force, -f

Forces processing of tables regardless of SQL errors encountered.


--help, -?

Displays basic help information.


--host= host, -h host

Specifies the name or IP address of the server for connection.


--medium-check, -m

This option is more thorough than the --check option and is less thorough than the --extended option.


--optimize, -o

Instructs the utility to optimize tables.


--password[= password], -p[ password]

Provides the password to pass to the server. A space is not permitted after -p if the password is given.


--port= port, -P port

Specifies the port to use for connecting to the server. The default is 3306.


--protocol= protocol

Specifies the protocol to use when connecting to the server. The choices are TCP, SOCKET, PIPE, and MEMORY.


--quick, -q

Checks tables faster by not scanning rows for incorrect links. When used to repair tables, it has the utility repair only the index tree. This option is the fastest method.


--repair, -r

Instructs the utility to repair tables. Note that it can't repair unique keys containing duplicates.


--silent, -s

Suppresses all messages except for error messages.


--socket= filename, -S filename

Provides the path and name of the server's socket file.


--tables

Specifies table names when using the --databases option.


--user= user, -u user

Specifies the username for connecting to the server.


--verbose, -v

Displays more information.


--version, -V

Displays the version of the utility.



MySQL in a Nutshell
MYSQL in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596514336
EAN: 2147483647
Year: 2006
Pages: 134
Authors: Russell Dyer

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net