Home >Database >Mysql Tutorial >MySQL慢查询日志_MySQL

MySQL慢查询日志_MySQL

WBOY
WBOYOriginal
2016-06-01 13:10:331132browse

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

 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn