집 >데이터 베이스 >MySQL 튜토리얼 >MySQL慢查询日志_MySQL
1、查看慢查询配置
//查看慢查询时间show variables like "long_query_time";默认10s
//查看慢查询配置情况show status like "%slow_queries%";
//查看慢查询日志路径 show variables like "%slow%";//查看日志位置 show variables like '%log%';
2、开启慢查询日志
在mysql home 目录下找到my.ini(windows环境)
在mysqld下增加
slow-query-log = onslow_query_log_file =F:/slowquery.loglong_query_time = 3log-queries-not-using-indexes = on
参考 http://macrotea.iteye.com/blog/1722031