当前位置: 移动技术网 > IT编程>数据库>Mysql > MySQL运行状况查询方式介绍

MySQL运行状况查询方式介绍

2017年12月12日  | 移动技术网IT编程  | 我要评论
show status
直接在命令行下登陆mysql运行show status;查询语句,详细如下图
 
同样的语句还有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运行信息,这种方式和第一种查看的信息基本一样。

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网