首页 > 其他 > 详细

使用 show status 命令

时间:2018-08-26 14:05:58      阅读:160      评论:0      收藏:0      [点我收藏+]

常用的:

--查看查询时间超过long_query_time秒的查询的个数。

show status like ‘slow_queries‘;

--查看创建时间超过slow_launch_time秒的线程数。

show status like ‘slow_launch_threads‘;

--查看不能立即获得的表的锁的次数。如果该值较高,并且有性能问题,你应首先优化查询,然后拆分表或使用复制。

show status like ‘table_locks_waited‘;

--查看立即获得的表的锁的次数。

show status like ‘table_locks_immediate‘;

--查看激活的(非睡眠状态)线程数。

show status like ‘threads_running‘;

--查看创建用来处理连接的线程数。如果Threads_created较大,你可能要增加thread_cache_size值。

show status like ‘threads_created‘;

--查看当前打开的连接的数量。

show status like ‘threads_connected‘;

--查看线程缓存内的线程的数量。

show status like ‘threads_cached‘;

--查看试图连接到MySQL(不管是否连接成功)的连接数

show status like ‘connections‘;

--查看delete语句的执行数

show [global] status like ‘com_delete‘;

--查看update语句的执行数

show [global] status like ‘com_update‘;

--查看insert语句的执行数

show [global] status like ‘com_insert‘;

--查看select语句的执行数

show [global] status like ‘com_select‘;

--查看MySQL本次启动后的运行时间(单位:秒)

show status like ‘uptime‘;

使用 show status 命令

原文:https://www.cnblogs.com/Typical-me/p/9537207.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!