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:

shell> 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.12 mysqladmin Options

Option NameDescriptionIntroducedDeprecated
--bind-addressUse specified network interface to connect to MySQL Server
--compressCompress all information sent between client and server8.0.18
--compression-algorithmsPermitted compression algorithms for connections to server8.0.18
--connect-timeoutNumber of seconds before connection timeout
--countNumber of iterations to make for repeated command execution
--debugWrite debugging log
--debug-checkPrint debugging information when program exits
--debug-infoPrint debugging information, memory, and CPU statistics when program exits
--default-authAuthentication plugin to use
--default-character-setSpecify default character set
--defaults-extra-fileRead named option file in addition to usual option files
--defaults-fileRead only named option file
--defaults-group-suffixOption group suffix value
--enable-cleartext-pluginEnable cleartext authentication plugin
--forceContinue even if an SQL error occurs
--get-server-public-keyRequest RSA public key from server
--helpDisplay help message and exit
--hostHost on which MySQL server is located
--login-pathRead login path options from .mylogin.cnf
--no-beepDo not beep when errors occur
--no-defaultsRead no option files
--passwordPassword to use when connecting to server
--pipeConnect to server using named pipe (Windows only)
--plugin-dirDirectory where plugins are installed
--portTCP/IP port number for connection
--print-defaultsPrint default options
--protocolTransport protocol to use
--relativeShow the difference between the current and previous values when used with the --sleep option
--server-public-key-pathPath name to file containing RSA public key
--shared-memory-base-nameShared-memory name for shared-memory connections (Windows only)
--show-warningsShow warnings after statement execution
--shutdown-timeoutThe maximum number of seconds to wait for server shutdown
--silentSilent mode
--sleepExecute commands repeatedly, sleeping for delay seconds in between
--socketUnix socket file or Windows named pipe to use
--ssl-caFile that contains list of trusted SSL Certificate Authorities
--ssl-capathDirectory that contains trusted SSL Certificate Authority certificate files
--ssl-certFile that contains X.509 certificate
--ssl-cipherPermissible ciphers for connection encryption
--ssl-crlFile that contains certificate revocation lists
--ssl-crlpathDirectory that contains certificate revocation-list files
--ssl-fips-modeWhether to enable FIPS mode on client side
--ssl-keyFile that contains X.509 key
--ssl-modeDesired security state of connection to server
--tls-ciphersuitesPermissible TLSv1.3 ciphersuites for encrypted connections8.0.16
--tls-versionPermissible TLS protocols for encrypted connections
--userMySQL user name to use when connecting to server
--verboseVerbose mode
--versionDisplay version information and exit
--verticalPrint query output rows vertically (one line per column value)
--waitIf the connection cannot be established, wait and retry instead of aborting
--zstd-compression-levelCompression level for connections to server that use zstd compression8.0.18