MySQL 5.7 Reference Manual Including MySQL NDB Cluster 7.5 and NDB Cluster 7.6

4.5.2 mysqladmin — A MySQL Server Administration Program

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:

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:

$> mysqladmin proc stat
+----+-------+-----------+----+---------+------+-------+------------------+
| Id | User  | Host      | db | Command | Time | State | Info             |
+----+-------+-----------+----+---------+------+-------+------------------+
| 51 | jones | localhost |    | Query   | 0    |       | show processlist |
+----+-------+-----------+----+---------+------+-------+------------------+
Uptime: 1473624  Threads: 1  Questions: 39487
Slow queries: 0  Opens: 541  Flush tables: 1
Open 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. For information about option files used by MySQL programs, see Section 4.2.2.2, “Using Option Files”.

Table 4.14 mysqladmin Options

Option Name Description Introduced Deprecated
--bind-address Use specified network interface to connect to MySQL Server
--character-sets-dir Directory where character sets can be found
--compress Compress all information sent between client and server
--connect-timeout Number of seconds before connection timeout
--count Number of iterations to make for repeated command execution
--debug Write debugging log
--debug-check Print debugging information when program exits
--debug-info Print debugging information, memory, and CPU statistics when program exits
--default-auth Authentication plugin to use
--default-character-set Specify default character set
--defaults-extra-file Read named option file in addition to usual option files
--defaults-file Read only named option file
--defaults-group-suffix Option group suffix value
--enable-cleartext-plugin Enable cleartext authentication plugin
--force Continue even if an SQL error occurs
--get-server-public-key Request RSA public key from server 5.7.23
--help Display help message and exit
--host Host on which MySQL server is located
--login-path Read login path options from .mylogin.cnf
--no-beep Do not beep when errors occur
--no-defaults Read no option files
--password Password to use when connecting to server
--pipe Connect to server using named pipe (Windows only)
--plugin-dir Directory where plugins are installed
--port TCP/IP port number for connection
--print-defaults Print default options
--protocol Transport protocol to use
--relative Show the difference between the current and previous values when used with the --sleep option
--secure-auth Do not send passwords to server in old (pre-4.1) format Yes
--server-public-key-path Path name to file containing RSA public key 5.7.23
--shared-memory-base-name Shared-memory name for shared-memory connections (Windows only)
--show-warnings Show warnings after statement execution
--shutdown-timeout The maximum number of seconds to wait for server shutdown
--silent Silent mode
--sleep Execute commands repeatedly, sleeping for delay seconds in between
--socket Unix socket file or Windows named pipe to use
--ssl Enable connection encryption
--ssl-ca File that contains list of trusted SSL Certificate Authorities
--ssl-capath Directory that contains trusted SSL Certificate Authority certificate files
--ssl-cert File that contains X.509 certificate
--ssl-cipher Permissible ciphers for connection encryption
--ssl-crl File that contains certificate revocation lists
--ssl-crlpath Directory that contains certificate revocation-list files
--ssl-key File that contains X.509 key
--ssl-mode Desired security state of connection to server 5.7.11
--ssl-verify-server-cert Verify host name against server certificate Common Name identity
--tls-version Permissible TLS protocols for encrypted connections 5.7.10
--user MySQL user name to use when connecting to server
--verbose Verbose mode
--version Display version information and exit
--vertical Print query output rows vertically (one line per column value)
--wait If the connection cannot be established, wait and retry instead of aborting