Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Summary of mysqladmin common commands

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The format of the mysqladmin tool:

Mysqladmin [option] command [command option] command.

Parameter options:

-c number auto-run count, must be used with-I

-I how often does number repeat execution

0) check the status of the server every two seconds, repeating a total of 5 times.

[root@test-huanqiu] # mysqladmin-uroot-p-I 2-c 5 status

1) check the status of server: status

[root@test-huanqiu] # mysqladmin-uroot-p status

2) modify the root password:

[root@test-huanqiu] # mysqladmin-u root-p original password password' newpassword'

3) check whether mysqlserver is available:

[root@test-huanqiu] # mysqladmin-uroot-p ping

4) query the version of the server

[root@test-huanqiu] # mysqladmin-uroot-p version

5) View the current value of the server status:

[root@test-huanqiu] # mysqladmin-uroot-p extended-status

6) query the variable value of the server system:

[root@test-huanqiu] # mysqladmin-uroot-p variables

7) display all running processes on the server:

[root@test-huanqiu] # mysqladmin-uroot-p processlist

[root@test-huanqiu ~] # mysqladmin-uroot-Pmuri 1 processlist / / refresh once per second

8) create a database

[root@test-huanqiu] # mysqladmin-uroot-p create daba-test

9) display all databases on the server

[root@test-huanqiu] # mysqlshow-uroot-p

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

[root@test-huanqiu] # mysqlshow-uroot-p daba-test

11) Statistical summary of database tables and columns under daba-test

[root@test-huanqiu] # mysqlshow-uroot-p daba-test-v

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

[root@test-huanqiu] # mysqlshow-uroot-p daba-test-v-v

13) Delete database daba-test

[root@test-huanqiu] # mysqladmin-uroot-p drop daba-test

14) overload permission information

[root@test-huanqiu] # mysqladmin-uroot-p reload

15) refresh all table caches and close and open log

[root@test-huanqiu] # mysqladmin-uroot-p refresh

16) use safe mode to shut down the database

[root@test-huanqiu] # mysqladmin-uroot-p shutdown

17) Refresh command mysqladmin flush commands

[root@test-huanqiu] # mysqladmin-u root-ptmppassword flush-hosts

[root@test-huanqiu] # mysqladmin-u root-ptmppassword flush-logs

[root@test-huanqiu] # mysqladmin-u root-ptmppassword flush-privileges

[root@test-huanqiu] # mysqladmin-u root-ptmppassword flush-status

[root@test-huanqiu] # mysqladmin-u root-ptmppassword flush-tables

[root@test-huanqiu] # mysqladmin-u root-ptmppassword flush-threads

18) mysqladmin executes the kill process:

[root@test-huanqiu] # mysqladmin-uroot-p processlist

[root@test-huanqiu] # mysqladmin-uroot-p kill idnum

19) stop and start MySQL replication on a slave server

[root@test-huanqiu] # mysqladmin-u root-p stop-slave

[root@test-huanqiu] # mysqladmin-u root-p start-slave

20) execute multiple commands at the same time

[root@test-huanqiu] # mysqladmin-u root-p process status version

The above summary of mysqladmin daily management orders under mysql (must see article) is all the content that the editor has shared with you. I hope I can give you a reference, and I also hope that you will support the script Home.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report