The mysqlcheck client performs table maintenance: It checks, repairs, optimizes, or analyzes tables.
mysqlcheck is similar in function to myisamchk, but works differently. The main operational difference is that mysqlcheck must be used when the mysqld server is running, whereas myisamchk should be used when it is not. The benefit of using mysqlcheck is that you do not have to stop the server to perform table maintenance.
mysqlcheck uses the SQL statements CHECK TABLE, REPAIR TABLE, ANALYZE TABLE, and OPTIMIZE TABLE in a convenient way for the user. It determines which statements to use for the operation you want to perform, and then sends the statements to the server to be executed.
There are three general ways to invoke mysqlcheck:
shell> mysqlcheck [options] db_name [tbl_name ...]
shell> mysqlcheck [options] --databases db_name ...
shell> mysqlcheck [options] --all-databases
The names shown in the following table can be used to change mysqlcheck default behavior.
Command
|
Meaning
|
mysqlrepair
|
The default option is --repair
|
mysqlanalyze
|
The default option is --analyze
|
mysqloptimize
|
The default option is --optimize
|
댓글 없음:
댓글 쓰기