In mysql, you can use the "show status" command to query the mysql status. This command is used to view the status information of the server. This command will display the name and value of each server variable. The status variables are read-only. , the syntax is "show status".
The operating environment of this tutorial: windows10 system, mysql8.0.22 version, Dell G3 computer.
How to query mysql status
At work, sometimes we need to know the status information of the MySQL server. At this time, we can use SHOW STATUS command to view server status information.
The SHOW STATUS command will display the name and value of each server variable. Status variables are read-only. We can run SHOW STATUS under the MySQL client or use mysqladmin extended-status on the command line to view these variables. If using SQL commands, you can use LIKE or WHERE to limit the results. LIKE can perform standard pattern matching on variable names.
SHOW STATUS is a mix of global and session variables, many of which have dual domains: they are both global variables and session variables, with the same name. If you only need to see global variables, you need to change SHOW GLOBAL STATUS to view them.
show databases displays all databases
Then use select the database to be operated
Then show statusView the status
Finally, all the attributes of the database are listed, which is very complete, as shown in the figure below
Recommended learning: mysql video tutorial
The above is the detailed content of How to query mysql status. For more information, please follow other related articles on the PHP Chinese website!