mysql 开启慢查询

linux启用MySQL慢查询

vim /etc/my.cnf
[mysqld]
slow-query-log = on 
slow_query_log_file = /var/log/slow_query.log 
long_query_time = 3 
log-queries-not-using-indexes = on # 列出没有使用索引的查询语句

  

Windows下开启MySQL慢查询

log-slow-queries = D:\log\mysql_low_query.log
long_query_time = 2

  

慢查询日志工具mysqlsla

mysqlsla -lt slow /var/log/slow_query.log

  

posted @ 2017-05-19 16:56  三木燕  阅读(148)  评论(0编辑  收藏  举报