18: MYSQLADMIN command parameters _ MYSQL

Source: Internet
Author: User
Tags x509 cert
18-MYSQL Getting started: Explanation of MYSQLADMIN command parameters bitsCN.com

18-MYSQL Getting started: MYSQLADMIN command parameters

Related links:

MYSQL: Basic operations

Http: // database/201212/173868 .html

MYSQL 2: use regular expressions to search

Http: // database/201212/173869 .html

MYSQL 3: full text search

Http: // database/201212/173873 .html

MYSQL entry 4: MYSQL data types

Http: // database/201212/175536 .html

MYSQL entry 5: MYSQL character set

Http: // database/201212/175541 .html

MYSQL getting started 6: MYSQL operators

Http: // database/201212/175862 .html

MYSQL entry 7: MYSQL common functions

Http: // database/201212/175864 .html

Step 8: basic database and table operations

Http: // database/201212/175867 .html

MYSQL entry 9: simple indexing operations

Http: // database/201212/176772 .html

MYSQL Getting started: Basic View operations

Http: // database/201212/176775 .html

MYSQL getting started 11: basic trigger operations

Http: // database/201212/176781 .html

MYSQL entry 12: basic operations of stored procedures

Http: // database/201212/177380 .html

Step 13: basic operations of user-defined functions

Http: // database/201212/177382 .html

MYSQL tutorial 14: basic operations on cursors

Http: // database/201212/177384 .html

MYSQL basics: basic operations for transaction processing

Http: // database/201212/177385 .html

MYSQL Getting started: MYSQL command parameters

Http: // database/201212/178079 .html

The mysqladmin tool is mainly used to perform some simple operations on the database and display the server status. The format is as follows:

Mysqladmin [option] command [command option] command ......

In the command line, enter mysqladmin -?, Print the following help information

[SQL]

C:/Users/qxl> mysqladmin -- help

Mysqladmin Ver 8.42 Distrib 5.1.28-rc, for Win32 on ia32

Copyright (C) 2000-2006 MySQL AB

This software comes with absolutely no warranty. This is free software,

And you are welcome to modify and redistribute it under the GPL license

Administration program for the mysqld daemon.

Usage: mysqladmin [OPTIONS] command ....

-C, -- count = # Number of iterations to make. This works with-I

(-- Sleep) only.

-- Debug-check memory and open file usage at exit.

-- Debug-info Print some debug info at exit.

-F, -- force Don't ask for confirmation on drop database;

Multiple commands, continue even if an error occurs.

-C, -- compress Use compression in server/client protocol.

-- Character-sets-dir = name

Directory where character sets are.

-- Default-character-set = name

Set the default character set.

-?, -- Help Display this help and exit.

-H, -- host = name Connect to host.

-B, -- no-beep Turn off beep on error.

-P, -- password [= name]

Password to use when connecting to server. If password is

Not given it's asked from the tty.

-W, -- pipe Use named pipes to connect to server.

-P, -- port = # Port number to use for connection or 0 for default to, in

Order of preference, my. cnf, $ MYSQL_TCP_PORT,

/Etc/services, built-in default (3306 ).

-- Protocol = name The protocol of connection (tcp, socket, pipe, memory ).

-R, -- relative Show difference between current and previous values when

Used with-I. Currently works only with extended-status.

-O, -- set-variable = name

Change the value of a variable. Please note that this

Option is deprecated; you can set variables directly

-- Variable-name = value.

-- Shared-memory-base-name = name

Base name of shared memory.

-S, -- silent Silently exit if one can't connect to server.

-S, -- socket = name Socket file to use for connection.

-I, -- sleep = # Execute commands again and again with a sleep.

-- Ssl Enable SSL for connection (automatically enabled

Other flags). Disable with -- skip-ssl.

-- Ssl-ca = name CA file in PEM format (check OpenSSL docs, implies

-- Ssl ).

-- Ssl-capath = name CA directory (check OpenSSL docs, implies -- ssl ).

-- Ssl-cert = name X509 cert in PEM format (implies -- ssl ).

-- Ssl-cipher = name SSL cipher to use (implies -- ssl ).

-- Ssl-key = name X509 key in PEM format (implies -- ssl ).

-- Ssl-verify-server-cert

Verify server's "Common Name" in its cert against

Hostname used when connecting. This option is disabled

Default.

-U, -- user = name User for login if not current user.

-V, -- verbose Write more information.

-V, -- version Output version information and exit.

-E, -- vertical Print output vertically. Is similar to -- relative,

Prints output vertically.

-W, -- wait [= #] Wait and retry if connection is down.

-- Connect_timeout = #

-- Shutdown_timeout = #

Variables (-- variable-name = value)

And boolean options {FALSE | TRUE} Value (after reading options)

--------------------------------------------------------------

Count 0

Debug-check FALSE

Debug-info FALSE

Force FALSE

Compress FALSE

Character-sets-dir (No default value)

Default-character-set (No default value)

Host (No default value)

No-beep FALSE

Port 0

Relative FALSE

Shared-memory-base-name (No default value)

Socket (No default value)

Sleep 0

Ssl FALSE

Ssl-ca (No default value)

Ssl-capath (No default value)

Ssl-cert (No default value)

Ssl-cipher (No default value)

Ssl-key (No default value)

Ssl-verify-server-cert FALSE

User (No default value)

Verbose FALSE

Vertical FALSE

Connect_timeout 43200

Shutdown_timeout 3600

Default options are read from the following files in the given order:

C:/Windows/my. ini C:/Windows/my. cnf C:/my. ini C:/my. cnf D:/APMServ5.2.6/MySQL5.1/my. ini D:/APMServ5.2.6/MySQL5.1/my. cnf

The following groups are read: mysqladmin client

The following options may be given as the first argument:

-- Print-defaults Print the program argument list and exit

-- No-defaults Don't read default options from any options file

-- Defaults-file = # Only read default options from the given file #

-- Defaults-extra-file = # Read this file after the global files are read

Where command is a one or more of: (Commands may be shortened)

Create databasename Create a new database

Debug Instruct server to write debug information to log

Drop databasename Delete a database and all its tables

Extended-status Gives an extended status message from the server

Flush-hosts Flush all cached hosts

Flush-logs Flush all logs

Flush-status Clear status variables

Flush-tables Flush all tables

Flush-threads Flush the thread cache

Flush-privileges Reload grant tables (same as reload)

Kill id, id,... Kill mysql threads

Password new-password Change old password to new-password, MySQL 4.1 hashing.

Old-password new-password Change old password to new-password in old format.

Ping Check if mysqld is alive

Processlist Show list of active threads in server

Reload Reload grant tables

Refresh Flush all tables and close and open logfiles

Shutdown Take server down

Status Gives a short status message from the server

Start-slave Start slave

Stop-slave Stop slave

Variables Prints variables available

Version Get version info from server

The help information includes three parts:

The first part is related to the mysqladmin command, which is described as follows:

-C, -- count = # Number of iterations to make. This works with-I (-- sleep) only. Number of automatic runs, must be used with-I

-- Debug-check memory and open file usage at exit.

-- Debug-info Print some debug info at exit.

-F, -- force Don't ask for confirmation on drop database; with multiple commands, continue even if an error occurs. forbidden Error. no prompt is displayed when you drop the database. if you execute multiple commands, the system continues to execute an error.

-C, -- compress Use compression in server/client protocol. Use compression between the server and client

-- Character-sets-dir = name Directory where character sets are. set the character set Directory

-- Default-character-set = name Set the default character set. set the default character Set directory.

-?, -- Help Display this help and exit. displays help information

-H, -- host = name Connect to host. host name

-B, -- no-beep Turn off beep on error. When an error is reported, no bell rings (beep)

-P, -- password [= name] Password to use when connecting to server. If password is not given it's asked from the tty. server connection password

-W, -- pipe Use named pipes to connect to server. Use the named pipe to connect to the server

-P, -- port = # Port number to use for connection or 0 for default to, in order of preference, my. cnf, $ MYSQL_TCP_PORT,/etc/services, built-in default (3306 ). port number

-- Protocol = name The protocol of connection (tcp, socket, pipe, memory). set The protocol used for The connection.

-R, -- relative Show difference between current and previous values when used with-I. Currently works only with extended-status. The value of the frontend and backend changes must be combined with-I

-O, -- set-variable = name Change the value of a variable. please note that this option is deprecated; you can set variables directly with -- variable-name = value. modify the value of a variable by using -- variable-name = value.

-- Shared-memory-base-name = name Base name of shared memory.

-S, -- silent Silently exit if one can't connect to server. exit if the connection fails.

-S, -- socket = name Socket file to use for connection. specify socket file

-I, -- sleep = # Execute commands again and again with a sleep between. Execute once at intervals

-- Ssl Enable SSL for connection (automatically enabled with other flags). Disable with -- skip-ssl.

-- Ssl-ca = name CA file in PEM format (check OpenSSL docs, implies -- ssl ).

-- Ssl-capath = name CA directory (check OpenSSL docs, implies -- ssl ).

-- Ssl-cert = name X509 cert in PEM format (implies -- ssl ).

-- Ssl-cipher = name SSL cipher to use (implies -- ssl ).

-- Ssl-key = name X509 key in PEM format (implies -- ssl ).

-- Ssl-verify-server-cert Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default.

-U, -- user = name User for login if not current user. user name

-V, -- verbose Write more information.

-V, -- version Output version information and exit. the version of MYSQLADMIN is displayed.

-E, -- vertical Print output vertically. Is similar to -- relative, but prints output vertically. vertical display output

-W, -- wait [= #] Wait and retry if connection is down. if the connection is disconnected, wait and try again.

-- Connect_timeout = # connection timeout

-- Shutdown_timeout = # Example of timeout shutdown:

[SQL]

C:/Users/qxl> mysqladmin-uroot-E-I 3-c 2 status

Uptime: 1590 Threads: 1 Questions: 5 Slow queries: 0 Opens: 15 Flush tables: 1 Open tables: 8 Queries per second

Avg: 0.3.

Uptime: 1593 Threads: 1 Questions: 5 Slow queries: 0 Opens: 15 Flush tables: 1 Open tables: 8 Queries per second

Avg: 0.3.

C:/Users/qxl> mysqladmin-V

Mysqladmin Ver 8.42 Distrib 5.1.28-rc, for Win32 on ia32

The second part is related variables of mysqladmin.

The third part is related server commands that mysqladmin can execute. The details are as follows:

Create databasename Create a new database create a new database

Debug Instruct server to write debug information to log notifies the server to write debugging information to the log

Drop databasename Delete a database and all its tables

Extended-status Gives an extended status message from the server provides an extended status message for the server.

Flush-hosts Flush all cached hosts clear all cached hosts

Flush-logs Flush all logs clear all logs

Flush-status Clear status variables

Flush-tables Flush all tables clear all tables

Flush-threads Flush the thread cache to clear the thread cache

Flush-privileges Reload grant tables (same as reload) re-load the authorization table (same as reload)

Kill id, id,... Kill mysql threads to kill the mysql thread

Password new-password Change old password to new-password, MySQL 4.1 hashing. Change the old password to a new password

Old-password new-password Change old password to new-password in old format. Change the password

Ping Check if mysqld is alive Check if mysqld is online

Processlist Show list of active threads in server displays the list of active threads in the service.

Reload Reload grant tables reload authorization table

Refresh Flush all tables and close and open logfiles: Wash all tables and close and open log files.

Shutdown Take server down turn off the server

Status Gives a short status message from the server provides the server's brief status message

Start-slave Start slave start slave

Stop-slave Stop slave disable slave

Variables Prints variables available: print available variables

Version Get version info from server Get server version information

Example:

[SQL]

C:/Users/qxl> mysqladmin-uroot version

Mysqladmin Ver 8.42 Distrib 5.1.28-rc, for Win32 on ia32

Copyright (C) 2000-2006 MySQL AB

This software comes with absolutely no warranty. This is free software,

And you are welcome to modify and redistribute it under the GPL license

Server version 5.1.28-rc-community

Protocol version 10

Connection localhost via TCP/IP

TCP port 3306

Uptime: 31 min 3 sec

Threads: 1 Questions: 23 Slow queries: 0 Opens: 16 Flush tables: 2 Open tables: 0 Queries per second avg: 0.12

C:/Users/qxl> mysqladmin-u root-p create test_admin

Enter password:

C:/Users/qxl> mysqladmin-u root-p drop test_admin

Enter password:

Dropping the database is potentially a very bad thing to do.

Any data stored in the database will be destroyed.

Do you really want to drop the 'test _ admin' database [y/N] y

Database "test_admin" dropped

C:/Users/qxl> mysqladmin-u root flush-status

C:/Users/qxl> mysqladmin-u root processlist

+ ---- + ------ + ---------------- + ---- + --------- + ------ + ------- + ------------------ +

| Id | User | Host | db | Command | Time | State | Info |

+ ---- + ------ + ---------------- + ---- + --------- + ------ + ------- + ------------------ +

| 21 | root | localhost: 8925 | Query | 0 | show processlist |

+ ---- + ------ + ---------------- + ---- + --------- + ------ + ------- + ------------------ +

C:/Users/qxl> mysqladmin-u root status

Uptime: 1947 Threads: 1 Questions: 32 Slow queries: 0 Opens: 18 Flush tables: 2 Open tables: 2 Queries per second

Avg: 0.16.

The detailed descriptions of mysqladmin-u root status output information are as follows:

Uptime: the number of seconds that the MySQL server has run.

Threads: Number of active Threads (customers)

Questions: number of queries from customers starting from mysqld

Slow queries: the number of queries that have exceeded long_query_time

Opens: how many tables have mysqld opened?

Flush tables: Number of flush..., refresh and reload commands

Open tables: number of opened tables

Queries per second avg: average query time

BitsCN.com

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.