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

MySQL慢查询日志_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:10:33
Original
1155 people have browsed it

1、查看慢查询配置

   

//查看慢查询时间show variables like "long_query_time";默认10s
Copy after login
//查看慢查询配置情况show status like "%slow_queries%";
Copy after login
//查看慢查询日志路径 show variables like "%slow%";//查看日志位置  show variables like '%log%';
Copy after login

 

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
Copy after login

 

参考 http://macrotea.iteye.com/blog/1722031

 

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template