.\" ** You probably do not want to edit this file directly ** .\" It was generated using the DocBook XSL Stylesheets (version 1.69.1). .\" Instead of manually editing it, you probably should edit the DocBook XML .\" source for it and then use the DocBook XSL Stylesheets to regenerate it. .TH "\\FBMYSQLADMIN\\FR" "1" "07/19/2006" "MySQL 4.1" "MySQL Database System" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .SH "NAME" mysqladmin \- client for administering a MySQL server .SH "SYNOPSIS" .HP 79 \fBmysqladmin [\fR\fB\fIoptions\fR\fR\fB] \fR\fB\fIcommand\fR\fR\fB [\fR\fB\fIcommand\-options\fR\fR\fB] [\fR\fB\fIcommand\fR\fR\fB [\fR\fB\fIcommand\-options\fR\fR\fB]] ...\fR .SH "DESCRIPTION" .PP \fBmysqladmin\fR 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. .PP Invoke \fBmysqladmin\fR like this: .sp .nf shell> \fBmysqladmin [\fR\fB\fIoptions\fR\fR\fB] \fR\fB\fIcommand\fR\fR\fB [\fR\fB\fIcommand\-arg\fR\fR\fB] [\fR\fB\fIcommand\fR\fR\fB [\fR\fB\fIcommand\-arg\fR\fR\fB]] ...\fR .fi .PP \fBmysqladmin\fR supports the commands described in the following list. Some of the commands take an argument following the command name. .TP 3 \(bu create \fIdb_name\fR .sp Create a new database named \fIdb_name\fR. .TP \(bu debug .sp Tell the server to write debug information to the error log. .TP \(bu drop \fIdb_name\fR .sp Delete the database named \fIdb_name\fR and all its tables. .TP \(bu extended\-status .sp Display the server status variables and their values. .TP \(bu flush\-hosts .sp Flush all information in the host cache. .TP \(bu flush\-logs .sp Flush all logs. .TP \(bu flush\-privileges .sp Reload the grant tables (same as reload). .TP \(bu flush\-status .sp Clear status variables. .TP \(bu flush\-tables .sp Flush all tables. .TP \(bu flush\-threads .sp Flush the thread cache. (Added in MySQL 3.23.16.) .TP \(bu kill \fIid\fR,\fIid\fR,... .sp Kill server threads. If multiple thread ID values are given, there must be no spaces in the list. .TP \(bu old\-password \fInew\-password\fR .sp This is like the password command but stores the password using the old (pre\-4.1) password\-hashing format. This command was added in MySQL 4.1.0. (See Section\ 6.9, \(lqPassword Hashing as of MySQL 4.1\(rq.) .TP \(bu password \fInew\-password\fR .sp Set a new password. This changes the password to \fInew\-password\fR for the account that you use with \fBmysqladmin\fR for connecting to the server. Thus, the next time you invoke \fBmysqladmin\fR (or any other client program) using the same account, you will need to specify the new password. .sp If the \fInew\-password\fR value contains spaces or other characters that are special to your command interpreter, you need to enclose it within quotes. On Windows, be sure to use double quotes rather than single quotes; single quotes are not stripped from the password, but rather are interpreted as part of the password. For example: .sp .nf shell> \fBmysqladmin password "my new password"\fR .fi .TP \(bu ping .sp Check whether the server is alive. The return status from \fBmysqladmin\fR is 0 if the server is running, 1 if it is not. Beginning with MySQL 4.0.22, the status is 0 even in case of an error such as Access denied, because that means the server is running but refused the connection, which is different from the server not running. .TP \(bu processlist .sp Show a list of active server threads. This is like the output of the SHOW PROCESSLIST statement. If the \fB\-\-verbose\fR option is given, the output is like that of SHOW FULL PROCESSLIST. .TP \(bu reload .sp Reload the grant tables. .TP \(bu refresh .sp Flush all tables and close and open log files. .TP \(bu shutdown .sp Stop the server. .TP \(bu start\-slave .sp Start replication on a slave server. (Added in MySQL 3.23.16.) .TP \(bu status .sp Display a short server status message. .TP \(bu stop\-slave .sp Stop replication on a slave server. (Added in MySQL 3.23.16.) .TP \(bu variables .sp Display the server system variables and their values. .TP \(bu version .sp Display version information from the server. .PP All commands can be shortened to any unique prefix. For example: .sp .nf shell> \fBmysqladmin proc stat\fR +\-\-\-\-+\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-+\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-+\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ | 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 .fi .PP The \fBmysqladmin status\fR command result displays the following values: .TP 3 \(bu Uptime .sp The number of seconds the MySQL server has been running. .TP \(bu Threads .sp The number of active threads (clients). .TP \(bu Questions .sp The number of questions (queries) from clients since the server was started. .TP \(bu Slow queries .sp The number of queries that have taken more than long_query_time seconds. See Section\ 10.5, \(lqThe Slow Query Log\(rq. .TP \(bu Opens .sp The number of tables the server has opened. .TP \(bu Flush tables .sp The number of flush\-*, refresh, and reload commands the server has executed. .TP \(bu Open tables .sp The number of tables that currently are open. .TP \(bu Memory in use .sp The amount of memory allocated directly by \fBmysqld\fR. This value is displayed only when MySQL has been compiled with \fB\-\-with\-debug=full\fR. .TP \(bu Maximum memory used .sp The maximum amount of memory allocated directly by \fBmysqld\fR. This value is displayed only when MySQL has been compiled with \fB\-\-with\-debug=full\fR. .PP If you execute \fBmysqladmin shutdown\fR when connecting to a local server using a Unix socket file, \fBmysqladmin\fR waits until the server's process ID file has been removed, to ensure that the server has stopped properly. .PP \fBmysqladmin\fR supports the following options: .TP 3 \(bu \fB\-\-help\fR, \fB\-?\fR .sp Display a help message and exit. .TP \(bu \fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR .sp The directory where character sets are installed. See Section\ 9.1, \(lqThe Character Set Used for Data and Sorting\(rq. .TP \(bu \fB\-\-compress\fR, \fB\-C\fR .sp Compress all information sent between the client and the server if both support compression. .TP \(bu \fB\-\-count=\fR\fB\fIN\fR\fR, \fB\-c \fR\fB\fIN\fR\fR .sp The number of iterations to make for repeated command execution. This works only with the \fB\-\-sleep\fR option. .TP \(bu \fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR, \fB\-# [\fR\fB\fIdebug_options\fR\fR\fB]\fR .sp Write a debugging log. The \fIdebug_options\fR string often is \'d:t:o,\fIfile_name\fR'. The default is \'d:t:o,/tmp/mysqladmin.trace'. .TP \(bu \fB\-\-default\-character\-set=\fR\fB\fIcharset_name\fR\fR .sp Use \fIcharset_name\fR as the default character set. See Section\ 9.1, \(lqThe Character Set Used for Data and Sorting\(rq. Added in MySQL 4.1.9. .TP \(bu \fB\-\-force\fR, \fB\-f\fR .sp Do not ask for confirmation for the drop \fIdb_name\fR command. With multiple commands, continue even if an error occurs. .TP \(bu \fB\-\-host=\fR\fB\fIhost_name\fR\fR, \fB\-h \fR\fB\fIhost_name\fR\fR .sp Connect to the MySQL server on the given host. .TP \(bu \fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR, \fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR .sp The password to use when connecting to the server. If you use the short option form (\fB\-p\fR), you \fIcannot\fR have a space between the option and the password. If you omit the \fIpassword\fR value following the \fB\-\-password\fR or \fB\-p\fR option on the command line, you are prompted for one. .sp Specifying a password on the command line should be considered insecure. See Section\ 7.6, \(lqKeeping Your Password Secure\(rq. .TP \(bu \fB\-\-port=\fR\fB\fIport_num\fR\fR, \fB\-P \fR\fB\fIport_num\fR\fR .sp The TCP/IP port number to use for the connection. .TP \(bu \fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR .sp The connection protocol to use. Added in MySQL 4.1. .TP \(bu \fB\-\-relative\fR, \fB\-r\fR .sp Show the difference between the current and previous values when used with the \fB\-\-sleep\fR option. Currently, this option works only with the extended\-status command. .TP \(bu \fB\-\-silent\fR, \fB\-s\fR .sp Exit silently if a connection to the server cannot be established. .TP \(bu \fB\-\-sleep=\fR\fB\fIdelay\fR\fR, \fB\-i \fR\fB\fIdelay\fR\fR .sp Execute commands repeatedly, sleeping for \fIdelay\fR seconds in between. The \fB\-\-count\fR option determines the number of iterations. .TP \(bu \fB\-\-socket=\fR\fB\fIpath\fR\fR, \fB\-S \fR\fB\fIpath\fR\fR .sp For connections to localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use. .TP \(bu \fB\-\-ssl*\fR .sp Options that begin with \fB\-\-ssl\fR specify whether to connect to the server via SSL and indicate where to find SSL keys and certificates. See Section\ 7.7.3, \(lqSSL Command Options\(rq. .TP \(bu \fB\-\-user=\fR\fB\fIuser_name\fR\fR, \fB\-u \fR\fB\fIuser_name\fR\fR .sp The MySQL username to use when connecting to the server. .TP \(bu \fB\-\-verbose\fR, \fB\-v\fR .sp Verbose mode. Print more information about what the program does. .TP \(bu \fB\-\-version\fR, \fB\-V\fR .sp Display version information and exit. .TP \(bu \fB\-\-vertical\fR, \fB\-E\fR .sp Print output vertically. This is similar to \fB\-\-relative\fR, but prints output vertically. .TP \(bu \fB\-\-wait[=\fR\fB\fIcount\fR\fR\fB]\fR, \fB\-w[\fR\fB\fIcount\fR\fR\fB]\fR .sp If the connection cannot be established, wait and retry instead of aborting. If a \fIcount\fR value is given, it indicates the number of times to retry. The default is one time. .PP You can also set the following variables by using \fB\-\-\fR\fB\fIvar_name\fR\fR\fB=\fR\fB\fIvalue\fR\fR syntax: .TP 3 \(bu connect_timeout .sp The maximum number of seconds before connection timeout. The default value is 43200 (12 hours). .TP \(bu shutdown_timeout .sp The maximum number of seconds to wait for server shutdown. The default value is 3600 (1 hour). .PP It is also possible to set variables by using \fB\-\-set\-variable=\fR\fB\fIvar_name\fR\fR\fB=\fR\fB\fIvalue\fR\fR or \fB\-O \fR\fB\fIvar_name\fR\fR\fB=\fR\fB\fIvalue\fR\fR syntax. However, this syntax is deprecated as of MySQL 4.0. .SH "SEE ALSO" isamchk(1), isamlog(1), msql2mysql(1), myisam_ftdump(1), myisamchk(1), myisamlog(1), myisampack(1), mysql(1), mysql.server(1), mysql_config(1), mysql_explain_log(1), mysql_fix_privilege_tables(1), mysql_zap(1), mysqlaccess(1), mysqlbinlog(1), mysqlcheck(1), mysqld(1), mysqld_multi(1), mysqld_safe(1), mysqldump(1), mysqlhotcopy(1), mysqlimport(1), mysqlshow(1), pack_isam(1), perror(1), replace(1), safe_mysqld(1) .P For more information, please refer to the MySQL Reference Manual, which may already be installed locally and which is also available online at http://dev.mysql.com/doc/. .SH AUTHOR MySQL AB (http://www.mysql.com/). This software comes with no warranty.