Home > Database > Mysql Tutorial > MySQL运行状况查询方式介绍_MySQL

MySQL运行状况查询方式介绍_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:24:27
Original
1098 people have browsed it

bitsCN.com SHOW STATUS
直接在命令行下登陆MySQL运行SHOW STATUS;查询语句,详细如下图
MySQL运行状况查询方式介绍_MySQL 
同样的语句还有SHOW VARIABLES;,SHOW STATUS是查看MySQL运行情况,和上面那种通过pma查看到的信息基本类似。

SHOW VARIABLES
SHOW VARIABLES是查看MySQL的配置参数,还可以使用类似SHOW VARIABLES LIKE 'Key%'

SHOW PROCESSLIST
SHOW PROCESSLIST是查看当前正在进行的进程,对于有锁表等情况的排查很有用处。一般情况下,打开MySQL的慢查询记录同样有利于排查。

SHOW OPEN TABLES
SHOW OPEN TABLES是显示当前已经被打开的表列表。

mysqladmin status
使用MySQL自带的mysqladmin 工具查看status,使用以下命令
mysqladmin -uroot --password='password' status
显示的结果如下:
Uptime: 87117 Threads: 1 Questions: 5481626 Slow queries: 16 Opens: 2211 Flush tables: 1 Open tables: 512 Queries per second avg: 62.923
另外可以添加 -i 5 参数,让其每五秒自动刷新之。
mysqladmin -uroot --password='password' status -i 5

mysqladmin extended-status
同样的可以使用mysqladmin -uroot --password='password' extended-status来查看更多的MySQL运行信息,这种方式和第一种查看的信息基本一样。bitsCN.com

Related labels:
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template