为了账号安全,请及时绑定邮箱和手机立即绑定

MySQL数据库维护中监控所用到的常用命令

标签:
MySQL

status = show status like ‘%%' [例:show status like 'Com_select']
variables = show variables like ‘%%' [例:show variables like 'query_cache_size']

1、MySQL查询次数(status)
Com_select;Com_update;Com_insert;Com_delete;Com_change_db

2、查询缓存空间大小:query_cache_size(variables)
查询缓存最大查询数据集大小:query_cache_limit(variables);
缓存中的查询个数:Qcache_inserts(status);
查询缓存命中率:(Qcache_hits/(Qcache_hits+Qcache_inserts))*100% (status)

3、索引缓存命中率
索引缓存空间大小:key_buffer_size (variables)
索引缓存命中率:(Key_reads/Key_read_requests)*100% (status)

4、并发连接数
最大充许连接数:max_connections(variables)
实际最大连接数:max_used_connections(status)
当前连接数:Threads_connected(status)
活跃连接数:Threads_running(status)
缓存连接数:Threads_cache(status)

5、流量统计(status)
Bytes_received ,Bytes_sent(status)

6、连接次数
每秒连接次数:Connections(status)
每秒实际创建连接次数:Threads_created(status)

7、表锁定统计
立即释放的表锁数:Table_locks_immediate(status)
需要等待的表锁数:Table_locks_waited(status)

点击查看更多内容
TA 点赞

若觉得本文不错,就分享一下吧!

评论

作者其他优质文章

正在加载中
  • 推荐
  • 评论
  • 收藏
  • 共同学习,写下你的评论
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦
今天注册有机会得

100积分直接送

付费专栏免费学

大额优惠券免费领

立即参与 放弃机会
意见反馈 帮助中心 APP下载
官方微信

举报

0/150
提交
取消