时间:2021-07-01 10:21:17 帮助过:8人阅读
//查看慢查询时间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