mysql性能检测常用命令_2020-08-14 MySQL查看数据库性能常用命令

转MySQL查看数据库性能常用命令

mysql> show global status; 列出MySQL服务器运行各种状态值

mysql> show variables; 查询MySQL服务器配置信息语句

一、慢查询

mysql> show variables like '%slow%';

mysql> show global status like '%slow%';

二、连接数

mysql> show variables like 'max_connections'; max_connections值过小:

mysql> show global status like ‘Max_used_connections’;

三、Key_buffer_size

mysql> show variables like ‘key_buffer_size’; 以MyISAM为主要存储引擎服务器的配置

mysql> show global status like 'key_read%'; key_buffer_size的使用情况

mysql> show global status like 'key_blocks_u%'; key_blocks_*参数

四、临时表

mysql> show global status like 'created_tmp%';

mysql> show variables where Variable_name in ('tmp_table_size', 'max_heap_table_size'); MySQL服务器对临时表的配置

五、Open Table情况

mysql> show global status like 'open%tables%'; Open_tables表示打开表的数量,Opened_tables表示打开过的表数量

mysql> show variables like 'table_cache'; 服务器table_cache值

六、进程使用情况

mysql> show global status like ‘Thread%’; Threads_created表示创建过的线程数

mysql> show variables like 'thread_cache_size'; 查询服务器thread_cache_size配置

七、查询缓存(query cache)

mysql> show global status like 'qcache%';

mysql> show variables like 'query_cache%'; 服务器关于query_cache的配置

八、排序使用情况

mysql> show global status like 'sort%';

九、文件打开数(open_files)

mysql> show global status like 'open_files';

十、表锁情况

mysql> show global status like 'table_locks%';

十一、表扫描情况

mysql> show global status like 'handler_read%';

mysql> show global status like 'com_select'; 调出服务器完成的查询请求次数

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值