Spec-Zone .ru
спецификации, руководства, описания, API

4.5.2. mysqladmin — Client for Administering a MySQL Server

mysqladmin is a client for performing administrative operations. You can use it to check the server's configuration and current status, to create and drop databases, and more.

Invoke mysqladmin like this:

shell> mysqladmin [options]
        command [command-arg] [command [command-arg]]
        ...

mysqladmin supports the following commands. Some of the commands take an argument following the command name.

All commands can be shortened to any unique prefix. For example:

shell> mysqladmin proc stat+----+-------+-----------+----+---------+------+-------+------------------+| Id | User  | Host      | db | Command | Time | State | Info             |+----+-------+-----------+----+---------+------+-------+------------------+| 51 | monty | localhost |    | Query   | 0    |       | show processlist |+----+-------+-----------+----+---------+------+-------+------------------+Uptime: 1473624  Threads: 1  Questions: 39487Slow queries: 0  Opens: 541  Flush tables: 1Open tables: 19  Queries per second avg: 0.0268

The mysqladmin status command result displays the following values:

If you execute mysqladmin shutdown when connecting to a local server using a Unix socket file, mysqladmin waits until the server's process ID file has been removed, to ensure that the server has stopped properly.

mysqladmin supports the following options, which can be specified on the command line or in the [mysqladmin] and [client] groups of an option file. mysqladmin also supports the options for processing option files described at Section 4.2.3.4, "Command-Line Options that Affect Option-File Handling".

Table 4.5. mysqladmin Options

Format Option File Description Introduced
--bind-address=ip_address bind-address Use the specified network interface to connect to the MySQL Server
--compress compress Compress all information sent between the client and the server
--connect_timeout=seconds connect_timeout The number of seconds before connection timeout
--count=# count The number of iterations to make for repeated command execution
--debug[=debug_options] debug Write a debugging log
--debug-check debug-check Print debugging information when the program exits
--debug-info debug-info Print debugging information, memory and CPU statistics when the program exits
--default-auth=plugin default-auth=plugin The authentication plugin to use
--default-character-set=charset_name default-character-set Use charset_name as the default character set
--enable-cleartext-plugin enable-cleartext-plugin Enable cleartext authentication plugin 5.6.7
--force force Continue even if an SQL error occurs
--help Display help message and exit
--host=host_name host Connect to the MySQL server on the given host
--login-path=name Read login path options from .mylogin.cnf 5.6.6
--no-beep no-beep Do not beep when errors occur
--password[=password] password The password to use when connecting to the server
--pipe On Windows, connect to server using a named pipe
--plugin-dir=path plugin-dir=path The directory where plugins are located
--port=port_num port The TCP/IP port number to use for the connection
--protocol=type protocol The connection protocol to use
--relative relative Show the difference between the current and previous values when used with the --sleep option
--shutdown_timeout=seconds shutdown_timeout The maximum number of seconds to wait for server shutdown
--silent silent Silent mode
--sleep=delay sleep Execute commands repeatedly, sleeping for delay seconds in between
--socket=path socket For connections to localhost
--ssl-ca=file_name ssl-ca The path to a file that contains a list of trusted SSL CAs
--ssl-capath=dir_name ssl-capath The path to a directory that contains trusted SSL CA certificates in PEM format
--ssl-cert=file_name ssl-cert The name of the SSL certificate file to use for establishing a secure connection
--ssl-cipher=cipher_list ssl-cipher A list of allowable ciphers to use for SSL encryption
--ssl-crl=file_name ssl-crl The path to a file that contains certificate revocation lists 5.6.3
--ssl-crlpath=dir_name ssl-crlpath The path to a directory that contains certificate revocation list files 5.6.3
--ssl-key=file_name ssl-key The name of the SSL key file to use for establishing a secure connection
--ssl-verify-server-cert ssl-verify-server-cert The server's Common Name value in its certificate is verified against the host name used when connecting to the server
--user=user_name, user MySQL user name to use when connecting to server
--verbose Verbose mode
--version Display version information and exit
--vertical vertical Print query output rows vertically (one line per column value)
--wait wait If the connection cannot be established, wait and retry instead of aborting

You can also set the following variables by using --var_name=value.