mysql, The Command-line Tool
mysqladmin, Administrating a MySQL Server
mysqlbinlog, Executing the queries from a binary log
mysqlcheck for Table Maintenance and Crash Recovery
mysqldump, Dumping Table Structure and Data
mysqlhotcopy, Copying MySQL Databases and Tables
mysqlimport, Importing Data from Text Files
mysqlshow, Showing Databases, Tables, and Columns
mysql_config, Get compile options for compiling clients
perror, Explaining Error Codes
mysqladmin, Administrating a MySQL ServerA utility for performing administrative operations. The syntax is:
shell> mysqladmin [OPTIONS] command [command-option] command ...
You can get a list of the options your version of mysqladmin supports
by executing mysqladmin --help.
The current mysqladmin supports the following commands:
create databasename
drop databasename
extended-status
flush-hosts
flush-logs
flush-tables
flush-privileges
kill id,id,...
password
ping
processlist
SHOW PROCESSLIST statement.
If the --verbose option is given, the output is like that of
SHOW FULL PROCESSLIST.
reload
refresh
shutdown
slave-start
slave-stop
status
variables
version
All commands can be shortened to their unique prefix. For example:
shell> mysqladmin proc stat +----+-------+-----------+----+-------------+------+-------+------+ | Id | User | Host | db | Command | Time | State | Info | +----+-------+-----------+----+-------------+------+-------+------+ | 6 | monty | localhost | | Processlist | 0 | | | +----+-------+-----------+----+-------------+------+-------+------+ Uptime: 10077 Threads: 1 Questions: 9 Slow queries: 0 Opens: 6 Flush tables: 1 Open tables: 2 Memory in use: 1092K Max memory used: 1116K
The mysqladmin status command result has the following columns:
| Column | Description |
| Uptime | Number of seconds the MySQL server has been up. |
| Threads | Number of active threads (clients). |
| Questions | Number of questions from clients since mysqld was started.
|
| Slow queries | Queries that have taken more than long_query_time seconds. See section 4.9.5 The Slow Query Log.
|
| Opens | How many tables mysqld has opened.
|
| Flush tables | Number of flush ..., refresh, and reload commands.
|
| Open tables | Number of tables that are open now. |
| Memory in use | Memory allocated directly by the mysqld code (only available when MySQL is compiled with --with-debug=full).
|
| Max memory used | Maximum memory allocated directly by the mysqld code (only available when MySQL is compiled with --with-debug=full).
|
If you do mysqladmin shutdown on a socket (in other words, on a
the computer where mysqld is running), mysqladmin will
wait until the MySQL pid-file is removed to ensure that
the mysqld server has stopped properly.