Mysqladmin Common usage

Source: Internet
Author: User

Mysqladmin use format for tools:
mysqladmin [option] command [command option] command ...

Parameter options:

-C Number Auto run count, must be used with-I
How long does the-I number interval repeat

0) Check the status of the server every two seconds and repeat the total 5 times.

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

1) View the status of the server: status

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

2) Change the root password:

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

3) Check if MySQLServer is available:

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

4) Query the version of the server

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

5) 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 of the server:

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

8) Create a database

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

9) Display all databases on the server

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

10) show what tables are in the database daba-test:

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

11) Summary of database table columns under statistical daba-test

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

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

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

13) Delete Database Daba-test

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

14) Overloaded Permissions information

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

15) Refresh all table caches and close and open log

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

16) Close the database using Safe mode

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

17) 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-ptmppassword flush-privileges
[Email protected] ~]# mysqladmin-u Root-ptmppassword flush-status
[Email protected] ~]# mysqladmin-u Root-ptmppassword flush-tables
[Email protected] ~]# mysqladmin-u Root-ptmppassword flush-threads

Mysqladmin execution Kill Process:

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

19) 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

20) Execute multiple commands at the same time

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

Description: Source Script House: https://www.jb51.net/article/48169.htm

Mysqladmin Common usage

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.