MySQL tool 1:mysqladmin

Source: Internet
Author: User
Tags openssl x509 cert

Show MySQL status every two seconds, showing 5 times.

# mysqladmin-uroot-p-I 2-c 5 status

To view the running status of MySQL:

#mysqladmin-uroot-p Ping

Mysqladmin Ver 8.42 distrib 5.1.73, for Redhat-linux-gnu on x86_64
Copyright (c) and/or, Oracle, its affiliates. All rights reserved.

Oracle is a registered trademark of the Oracle Corporation and/or its
Affiliates. Other names trademarks of their respective
Owners.

Administration program for the mysqld daemon.
Usage: mysqladmin [OPTIONS] Command command ....

-C Number Auto run count, must be used with-I

How long does the-I number interval repeat
-C,--count=# number of iterations to make. This works With-i
(--sleep) only.
--debug-check 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.
-C,--compress use compression in Server/client protocol.
--character-sets-dir=name
Directory for character set files.
--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.
-P,--port=# port number to connection or 0 for default
Order of preference, MY.CNF, $MYSQL _tcp_port,
/etc/services, built-in default (3306).
--protocol=name the protocol to use for connection (TCP, socket, pipe,
Memory).
-R,--relative Show difference between current and previous values when
Used With-i. Currently works with Extended-status.
-O,--set-variable=name
Change the value of a variable. Please note the This
option is deprecated; Can set variables directly with
--variable-name=value.
-S,--silent silently exit if one can ' t connect to server.
-S,--socket=name the socket file to use for connection.
-I,--sleep=# Execute commands repeatedly with a sleep between.
--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 was disabled by
Default.
-U,--user=name user for login if is not current user.
-V,--verbose Write more information.
-V,--version Output version information and exit.
-E,--vertical Print output vertically. is similar to--relative, but
Prints output vertically.
-W,--wait[=#] Wait and retry if connection are 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
Socket (no default value)
Sleep 0
SSL FALSE
Ssl-ca (no default value)
Ssl-capath (no default value)
SS L-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 is read from the following files in the given order:
/etc/mysql/my.cnf/etc/my.cnf ~/.my.cnf
The Following groups is Read:mysqladmin client
The following options may be given as the first argument:
--print-defa Ults Print The program argument list and exit.
--no-defaults Don ' t read the default options from the any option file.
--defaults-file=# only read default options from the given file #.
--defaults-extra-file=# Read this file after the global files is read.

Where command is a one or more: (Commands 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 lo GS
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 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

MySQL tool 1:mysqladmin

Related Article

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.