hi,
在配置文件中配置了慢日志,但是到目标文件夹下查看却没有,请问哪里出问题了1.配置文件
log-slow-queries="D:/mysql/slowlog"
long_query_time=0.01
log-queries-not-using-indexes2.查询结果 
|    5 | 10   | 2009-09-22 15:29:25 |
|    8 | 3    | 2009-09-21 14:30:06 |
|   10 | 2232 | 2009-09-22 14:27:21 |
|   11 | 2123 | 2009-09-22 14:27:25 |
|   12 | 34   | 2009-09-22 14:27:32 |
+------+------+---------------------+
19290 rows in set (0.08 sec)

解决方案 »

  1.   

    你的  long_query_time 设置应该是不对的。检查一下你的以下信息。
    mysql> show variables like 'long_query_time';
    +-----------------+-----------+
    | Variable_name   | Value     |
    +-----------------+-----------+
    | long_query_time | 10.000000 |
    +-----------------+-----------+
    1 row in set (0.06 sec)mysql> show variables like '%slow%';
    +---------------------+-------+
    | Variable_name       | Value |
    +---------------------+-------+
    | log_slow_queries    | ON    |
    | slow_launch_time    | 2     |
    | slow_query_log      | ON    |
    | slow_query_log_file |       |
    +---------------------+-------+
    4 rows in set (0.00 sec)mysql> show variables like 'log_output';
    +---------------+-------+
    | Variable_name | Value |
    +---------------+-------+
    | log_output    | FILE  |
    +---------------+-------+
    1 row in set (0.00 sec)mysql> select version();
    +----------------------+
    | version()            |
    +----------------------+
    | 5.1.33-community-log |
    +----------------------+
    1 row in set (0.00 sec)mysql>
      

  2.   

    没看出什么问题
    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql>
    mysql>  show variables like 'long_query_time';
    +-----------------+----------+
    | Variable_name   | Value    |
    +-----------------+----------+
    | long_query_time | 0.010000 |
    +-----------------+----------+
    1 row in set (0.00 sec)mysql> show variables like '%slow%';
    +---------------------+------------------+
    | Variable_name       | Value            |
    +---------------------+------------------+
    | log_slow_queries    | ON               |
    | slow_launch_time    | 2                |
    | slow_query_log      | ON               |
    | slow_query_log_file | D:/mysql/slowlog |
    +---------------------+------------------+
    4 rows in set (0.00 sec)mysql> show variables like 'log_output';
    +---------------+-------+
    | Variable_name | Value |
    +---------------+-------+
    | log_output    | FILE  |
    +---------------+-------+
    1 row in set (0.00 sec)mysql> select version();
    +-------------------------+
    | version()               |
    +-------------------------+
    | 5.1.23-rc-community-log |
    +-------------------------+
    1 row in set (0.00 sec)
      

  3.   

    mysql的官方版本是不是不能记录小于1秒的慢查询的,long_query_time只能大于等于1
      

  4.   

    mysql> exit;
    ByeD:\mysql\slowlog>dir
     驱动器 D 中的卷是 D
     卷的序列号是 881B-DFA6 D:\mysql\slowlog 的目录2009-10-22  16:48    <DIR>          .
    2009-10-22  16:48    <DIR>          ..
                   0 个文件              0 字节
                   2 个目录  5,151,195,136 可用字节
      

  5.   

    Prior to MySQL 5.1.21, the minimum value is 1, and the value for this variable must be an integer. Beginning with MySQL 5.1.21, the minimum is 0, and a resolution of microseconds is supported when logging to a file. However, the microseconds part is ignored and only integer values are written when logging to tables. 你的版本没有问题。 | 5.1.23-rc-community-log |这样 检查一下你的 datadir; 有没有这个log.
    mysql> select @@datadir;
    +-----------------------------------------------+
    | @@datadir                                     |
    +-----------------------------------------------+
    | C:\Program Files\MySQL\MySQL Server 5.1\DATA\ |
    +-----------------------------------------------+
    1 row in set (0.00 sec)mysql>
      

  6.   

    知道了,我自己的问题log-slow-queries="D:/mysql/slowlog" 
    slowlog指的是文件名,其实我己经在D:/mysql下建了文件夹,重复了修改为,下面的就OK了
    #add by xinsj on 20091022 for slow log
    log-slow-queries="D:/mysql/slowlog/slowlog"
    #log-slow-queries
    long_query_time=0.01
    #log-queries-not-using-indexes添麻烦了,多谢!