mysqladmin [options] command [command-options] | |
Use this to perform MySQL server administration tasks from the command line. You can use it to check the server's status and settings, flush tables, change passwords, shut down the server, and perform a few other administrative functions. This utility interacts with the MySQL server. Here is an alphabetical list of options that you can give as the first argument to the utility:
- --character-sets-dir= path
-
Specifies the directory that contains character sets.
- --compress, -C
-
Instructs the utility to compress data passed between it and the server if supported.
- --connect_timeout= number
-
Sets the number of seconds a connection may be idle before it will time out.
- --count= number, -c number
-
Specifies the number of iterations of commands to perform in conjunction with the --sleep option.
- --debug= settings,filename, -# settings, filename
-
Instructs the utility to write debugging information to the log specified along with various settings (e.g., 'd:t:o,logname').
- --force, -f
-
Forces execution of the DROP DATABASE statement and others despite error messages.
- --help, -?
-
Displays basic help information.
- --host= host , -h host
-
Specifies the name or IP address of the server for connection.
- --password[= password], -p[ password]
-
Provides the password to give to the server. No spaces are allowed between the -p and the password. If a password is not given, the user will be prompted for one.
- --port= port, -P port
-
Specifies the port on which to connect to the server. The default is 3306.
- --relative, -r
-
Instructs the utility to display the differences between values with each iteration of commands issued with the --sleep option.
- --shutdown_timeout= number
-
Sets the number of seconds the client should wait before shutting down.
- --silent, -s
-
Tells the utility to exit without error messages if a connection to the server cannot be established.
- --sleep= seconds, -i seconds
-
Specifies the number of seconds to wait between the repeated execution of commands. The number of iterations is set by the --count option.
- --socket= filename, -S filename
-
Provides the path and name of the server's socket file.
- --user= user, -u user
-
Specifies a MySQL user other than the current filesystem user.
- --verbose, -v
-
Displays more information.
- --version, -V
-
Displays the version of the utility.
- --vertical, -E
-
Displays output in a vertical format with a separate line for each column of data.
- --wait[= number], -w [ number]
-
Instructs the utility to wait until it can connect to the server. It will retry once unless the number of times it is to retry is given with this option. Commands The main focus of mysqladmin are the commands that perform administrative tasks. Commands are given as the second argument. You can issue one or more commands on the same line. Here is an alphabetical list of commands (with options for some) and an explanation of each:
- create database
-
Creates the new database specified.
- drop database
-
Deletes the database specified.
- extended-status
-
Displays the MySQL server's extended status information.
- flush-hosts
-
Flushes all cached hosts.
- flush-logs
-
Instructs the utility to flush all logs.
- flush-privileges
-
Reloads the grant tables.
- flush-status
-
Flushes status variables.
- flush-tables
-
Has the utility flush all tables.
- flush-threads
-
Flushes the thread cache.
- kill id
-
Kills the server thread specified by an identifier. Additional threads may be given in a comma-separated list.
- password password
-
Changes the password of the user currently connected to the server through the utility to the password given.
- ping
-
Determines if the server is running.
- processlist
-
Displays a list of active server threads. With the --verbose option, more information is provided on each thread.
- refresh
-
Flushes all tables and reloads logfiles.
- reload
-
Reloads the grant tables.
- shutdown
-
Shuts down the MySQL server.
- start-slave
-
Starts a replication slave server.
- status
-
Displays the server's status.
- stop-slave
-
Stops a replication slave server.
- variables
-
Displays the variables and the values of the server.
- version
-
Displays the version of the utility. |