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: 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.6, “Using Option Files”.

Table 4.4 mysqladmin Options

FormatDescriptionIntroduced
--compressCompress all information sent between client and server 
--connect_timeoutNumber of seconds before connection timeout 
--countNumber of iterations to make for repeated command execution 
--debugWrite debugging log 
--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 value5.0.10
--forceContinue even if an SQL error occurs 
--helpDisplay help message and exit 
--hostConnect to MySQL server on given host 
--no-defaultsRead no option files 
--passwordPassword to use when connecting to server 
--pipeOn Windows, connect to server using named pipe 
--portTCP/IP port number to use for connection 
--print-defaultsPrint default options 
--protocolConnection protocol to use 
--relativeShow the difference between the current and previous values when used with the --sleep option 
--shared-memory-base-nameThe name of shared memory to use for shared-memory connections 
--shutdown_timeoutThe maximum number of seconds to wait for server shutdown 
--silentSilent mode 
--sleepExecute commands repeatedly, sleeping for delay seconds in between 
--socketFor connections to localhost, the Unix socket file to use 
--sslEnable SSL for connection 
--ssl-caPath of file that contains list of trusted SSL CAs 
--ssl-capathPath of directory that contains trusted SSL CA certificates in PEM format 
--ssl-certPath of file that contains X509 certificate in PEM format 
--ssl-cipherList of permitted ciphers to use for SSL encryption 
--ssl-keyPath of file that contains X509 key in PEM format 
--ssl-verify-server-certVerify Common Name value in server certificate against host name used when connecting to server5.0.23
--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 

You can also set the following variables by using --var_name=value The --set-variable format is deprecated. syntax:

It is also possible to set variables by using --var_name=value. The --set-variable format is deprecated.