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, see Section 4.2.6, “Using Option Files”.

Table 4.3 mysqladmin Options

FormatOption FileDescriptionIntroduced
--bind-address=ip_addressbind-addressUse specified network interface to connect to MySQL Server5.1.22-ndb-6.3.4
--compresscompressCompress all information sent between client and server 
--connect_timeout=secondsconnect_timeoutThe number of seconds before connection timeout 
--count=#countThe number of iterations to make for repeated command execution 
--debug[=debug_options]debugWrite a debugging log 
--debug-checkdebug-checkPrint debugging information when program exits5.1.21
--debug-infodebug-infoPrint debugging information, memory, and CPU statistics when program exits5.1.14
--default-character-set=charset_namedefault-character-setSpecify default character set 
--defaults-extra-file=file_name Read option file in addition to the usual option files 
--defaults-file=file_name Read only the given option file 
--defaults-group-suffix=str Option group suffix value 
--forceforceContinue even if an SQL error occurs 
--help Display help message and exit 
--host=host_namehostConnect to MySQL server on given host 
--no-beepno-beepDo not beep when errors occur5.1.17
--no-defaults Read no option files 
--password[=password]passwordPassword to use when connecting to server 
--pipepipeOn Windows, connect to server using named pipe 
--port=port_numportTCP/IP port number to use for connection 
--print-defaults Print defaults 
--protocol=typeprotocolConnection protocol to use 
--relativerelativeShow the difference between the current and previous values when used with the --sleep option 
--shared-memory-base-name=nameshared-memory-base-nameThe name of shared memory to use for shared-memory connections 
--shutdown_timeout=secondsshutdown_timeoutThe maximum number of seconds to wait for server shutdown 
--silentsilentSilent mode 
--sleep=delaysleepExecute commands repeatedly, sleeping for delay seconds in between 
--socket=pathsocketFor connections to localhost, the Unix socket file to use 
--sslsslEnable SSL for connection 
--ssl-ca=file_namessl-caPath of file that contains list of trusted SSL CAs 
--ssl-capath=dir_namessl-capathPath of directory that contains trusted SSL CA certificates in PEM format 
--ssl-cert=file_namessl-certPath of file that contains X509 certificate in PEM format 
--ssl-cipher=cipher_listssl-cipherList of permitted ciphers to use for SSL encryption 
--ssl-key=file_namessl-keyPath of file that contains X509 key in PEM format 
--ssl-verify-server-certssl-verify-server-certVerify server Common Name value in its certificate against host name used when connecting to server5.1.11
--user=user_name,userMySQL user name to use when connecting to server 
--verbose Verbose mode 
--version Display version information and exit 
--verticalverticalPrint query output rows vertically (one line per column value) 
--waitwaitIf 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 and is removed in MySQL 5.5.