mysql5.5 开启慢查询日志

来源:互联网 发布:sql 2005什么用 编辑:程序博客网 时间:2024/05/01 02:35

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

 

    [mysqld]            log_slow_queries=ON      long_query_time=2      slow_query_log=ON      log_queries_not_using_indexes=ON      slow_query_log_file=C:/ProgramData/MySQL/MySQL Server 5.5/Data/log/slow.log            # The TCP/IP Port the MySQL Server will listen on      port=3306  

原文:http://macrotea.iteye.com/blog/1722031

0 0
原创粉丝点击