mysql5.5 开启慢查询日志

来源:互联网 发布:冒险岛夜光法师v矩阵 编辑:程序博客网 时间:2024/04/30 05:33

转自:http://macrotea.iteye.com/blog/1722031

1. mysql 5.5 可能和别的版本的在my.ini配置中的关键字可能不同


2.如何发现关键字
mysql> show variables like '%log%';


结果:

| log_slow_queries                        ON

| slow_query_log                           ON
| slow_query_log_file                     C:\ProgramData\MySQL\MySQL Server 5.5\Data\Macrotea-PC-slow.log


3.修改 my.ini

 

 

Xml代码  收藏代码
  1. [mysqld]  
  2.   
  3. log_slow_queries=ON  
  4. long_query_time=2  
  5. slow_query_log=ON  
  6. log_queries_not_using_indexes=ON  
  7. slow_query_log_file=E:/Application/Category/Java/_ISCAS/SIE/slow-query.log  
  8.   
  9. # The TCP/IP Port the MySQL Server will listen on  
  10. port=3306  
 

4.如上,需要配置的我都列出来了,over


0 0