mysqladmin Command Common parameter examples explained

Source: Internet
Author: User
Tags safe mode

mysqladminuse format for tool:
mysqladmin [option] command [command option] command ...

Parameter options:

- C number Auto Run count, must and - I. used together
How long does the-I number interval repeat

0 ) View the status of the server every two seconds, with a total of duplicates 5 times.

[Email protected] ~]# mysqladmin-uroot-p-I 2-c 5 status

1 ) to view the status of the server: Status

[Email protected] ~]# mysqladmin-uroot-p status

2 ) Modify Root Password:

[email protected] ~]# mysqladmin-u root-p Original Password password ' newpassword '

3 ) Check MySQLServer is available:

[[email protected] ~]# mysqladmin-uroot-p Ping

4 ) Query the version of the server

[Email protected] ~]# mysqladmin-uroot-p version

5 ) to view the current value of the server status:

[Email protected] ~]# mysqladmin-uroot-p extended-status

6 ) query Server system variable values:

[Email protected] ~]# mysqladmin-uroot-p variables

7 ) Displays all running processes for the server:

[Email protected] ~]# mysqladmin-uroot-p processlist
[[email protected] ~]# mysqladmin-uroot-p-i 1 processlist // Refresh once per second

8 ) to create a database

[Email protected] ~]# mysqladmin-uroot-p Create Daba-test

9 ) displays all databases on the server

[Email protected] ~]# mysqlshow-uroot-p

Ten ) Displays the database daba-test below are some of the tables:

[Email protected] ~]# mysqlshow-uroot-p daba-test

One ) Statistics daba-test Summary of the following database table columns

[Email protected] ~]# mysqlshow-uroot-p daba-test-v

A ) Statistics daba-test the number of columns and rows of the following database table

[Email protected] ~]# mysqlshow-uroot-p daba-test-v-V

- ) Delete the database daba-test

[Email protected] ~]# mysqladmin-uroot-p drop daba-test

- ) Overloaded Permissions information
[Email protected] ~]# mysqladmin-uroot-p Reload

the ) Refreshes all table caches and closes and opens Log

[[email protected] ~]# mysqladmin-uroot-p Refresh

- ) to shut down the database using Safe Mode

[Email protected] ~]# mysqladmin-uroot-p shutdown

- ) Refresh Command mysqladmin Flush Commands

[[email protected" ~]# mysqladmin-u root-ptmppassword flush-hosts
[[email  Protected] ~]# mysqladmin-u root-ptmppassword flush-logs
[[email protected] ~]# mysqladmin-u root-ptmppasswor D flush-privileges
[[email protected] ~]# mysqladmin-u root-ptmppassword flush-status
[[email  Protected] ~]# mysqladmin-u root-ptmppassword flush-tables
[[email protected] ~]# mysqladmin-u ROOT-PTMPPASSW Ord Flush-threads

- ) mysqladmin Execution Kill Process:

[Email protected] ~]# mysqladmin-uroot-p processlist
[Email protected] ~]# mysqladmin-uroot-p kill Idnum

+ ) stop and start MySQL Replication on a Slave server

[Email protected] ~]# mysqladmin-u root-p stop-slave
[Email protected] ~]# mysqladmin-u root-p start-slave

- execute multiple commands simultaneously

[Email protected] ~]# mysqladmin-u root-p process status version


mysqladmin Command Common parameter examples explained

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.