Summary of mysqladmin daily management commands under MySQL (must read)

Summary of mysqladmin daily management commands under MySQL (must read)

The usage format of the mysqladmin tool is:
mysqladmin [option] command [command option] command ......

Parameter options:

-c number Automatically run the number of times, must be used together with -i
-i number How long does it take to repeat the execution?

0) Check the server status every two seconds, and repeat it 5 times in total.

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

1) Check the status of the server: status

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

2) Change 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 server version

[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 server system variable value:

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

7) Display all running processes of the server:

[root@test-huanqiu ~]# mysqladmin -uroot -p processlist
[root@test-huanqiu ~]# mysqladmin -uroot -pi 1 processlist //Refresh once a 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) Display the tables under the database daba-test:

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

11) Statistics of database table columns under daba-test

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

12) Count the number of columns and rows in the database table under daba-test

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

13) Delete the 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 logs

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

16) Shut down the database in safe mode

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

17) Refresh commands 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 simultaneously

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

The above summary of mysqladmin daily management commands under MySQL (must read) is all the content that the editor shares with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM.

You may also be interested in:
  • How to use mysqladmin to get the current TPS and QPS of a MySQL instance
  • Tutorial on using mysqladmin to detect MySQL running status
  • Use mysqladmin extended-status with Linux commands to view MySQL running status in Linux
  • mysql DBA: Summary of common mysqladmin commands
  • How to remotely manage MySQL through mysqladmin
  • Introduction to using the MySQL mysqladmin client

<<:  JavaScript pie chart example

>>:  Summary of five commands to check swap space in Linux

Recommend

Detailed explanation of how to exit Docker container without closing it

After entering the Docker container, if you exit ...

Detailed explanation of Linux mpstat command usage

1. mpstat command 1.1 Command Format mpstat [ -A ...

JavaScript implementation of verification code case

This article shares the specific code for JavaScr...

Initial summary of the beginner's website building tutorial

After writing these six articles, I started to fee...

One line of code teaches you how to hide Linux processes

Friends always ask me how to hide Linux processes...

How to use the concat function in mysql

As shown below: //Query the year and month of the...

Detailed explanation of crontab scheduled execution command under Linux

In LINUX, periodic tasks are usually handled by t...

How to deploy HTTPS for free on Tencent Cloud

Recently, when I was writing a WeChat applet, the...

How to use border-image to implement text bubble border sample code

During the development activity, I encountered a ...

Vue+swiper realizes timeline effect

This article shares the specific code of vue+swip...

Tutorial on how to create a comment box with emoticons using HTML and CSS

HTML comment box with emoticons. The emoticons ar...

How to bypass unknown field names in MySQL

Preface This article introduces the fifth questio...

A brief analysis of controlled and uncontrolled components in React

Table of contents Uncontrolled components Control...

SQL implementation of LeetCode (196. Delete duplicate mailboxes)

[LeetCode] 196.Delete Duplicate Emails Write a SQ...