Home >Database >Mysql Tutorial >How to query mysql status

How to query mysql status

WBOY
WBOYOriginal
2022-01-18 15:47:4213556browse

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".

How to query mysql 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

How to query mysql status

Then use select the database to be operated

How to query mysql status

Then show statusView the status

How to query mysql status

Finally, all the attributes of the database are listed, which is very complete, as shown in the figure below

How to query mysql status

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn