# Example MySQL config file for small systems.
#
# This is for a system with little memory (<= 64M) where MySQL is only used
# from time to time and it's important that the mysqld daemon
# doesn't use much resources.
#
# You can copy this file to
# C:/xampp/mysql/bin/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is C:/xampp/mysql/data) or
# ~/.my.cnf to set user-specific options.
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.# The following options will be passed to all MySQL clients
[client] 
# password       = your_password 
port            = 3306 
socket          = mysql # Here follows entries for some specific programs # The MySQL server 
[mysqld] 
basedir="C:/xampp/mysql" 
tmpdir="C:/xampp/tmp" 
datadir="C:/xampp/mysql/data" port            = 3306 
socket          = mysql old-passwords 
character-set-server = latin1
collation-server = latin1_general_ciskip-locking
key_buffer = 16K
max_allowed_packet = 1M
table_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 64K# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (using the "enable-named-pipe" option) will render mysqld useless!

#skip-networking
server-id = 1# Uncomment the following if you want to log updates
#log-bin=C:/xampp/mysql/data/mysql-bin# Uncomment the following if you are NOT using BDB tables
skip-bdbskip-innodb 
# Uncomment the following if you are using InnoDB tables 
#innodb_data_home_dir = C:/xampp/mysql/data/
#innodb_data_file_path = ibdata1:10M:autoextend 
#innodb_log_group_home_dir = C:/xampp/mysql/data/
#innodb_log_arch_dir = C:/xampp/mysql/data/
# You can set .._buffer_pool_size up to 50 - 80 % 
# of RAM but beware of setting memory usage too high 
#set-variable = innodb_buffer_pool_size=16M 
#set-variable = innodb_additional_mem_pool_size=2M 
# Set .._log_file_size to 25 % of buffer pool size 
#set-variable = innodb_log_file_size=5M 
#set-variable = innodb_log_buffer_size=8M 
#innodb_flush_log_at_trx_commit=1 
#set-variable = innodb_lock_wait_timeout=50 [mysqldump] 
quick 
max_allowed_packet=16M [mysql] 
no-auto-rehash 
# Remove the next comment character if you are not familiar with SQL 
#safe-updates [isamchk] 
key_buffer = 8M
sort_buffer_size = 8M[myisamchk] 
key_buffer = 8M
sort_buffer_size = 8M[mysqlhotcopy] 
interactive-timeout [WinMySQLadmin] 
Server="C:/xampp/mysql/bin/mysqld.exe"
#user=root
#password=
log-slow-queries=c:/slowquery.log
long_query_time=1
//------------慢查询日志配置但是在c:\下并没有这个文件.....

解决方案 »

  1.   

    log-slow-queries="c:/slowquery.log" 加上双引号··
      

  2.   


    # Example MySQL config file for small systems.
    #
    # This is for a system with little memory (<= 64M) where MySQL is only used
    # from time to time and it's important that the mysqld daemon
    # doesn't use much resources.
    #
    # You can copy this file to
    # C:/xampp/mysql/bin/my.cnf to set global options,
    # mysql-data-dir/my.cnf to set server-specific options (in this
    # installation this directory is C:/xampp/mysql/data) or
    # ~/.my.cnf to set user-specific options.
    #
    # In this file, you can use all long options that a program supports.
    # If you want to know which options a program supports, run the program
    # with the "--help" option.# The following options will be passed to all MySQL clients
    [client] 
    # password       = your_password 
    port            = 3306 
    socket          = mysql # Here follows entries for some specific programs # The MySQL server 
    [mysqld] 
    basedir="C:/xampp/mysql" 
    tmpdir="C:/xampp/tmp" 
    datadir="C:/xampp/mysql/data" port            = 3306 
    socket          = mysql old-passwords 
    character-set-server = latin1
    collation-server = latin1_general_ciskip-locking
    key_buffer = 16K
    max_allowed_packet = 1M
    table_cache = 4
    sort_buffer_size = 64K
    read_buffer_size = 256K
    read_rnd_buffer_size = 256K
    net_buffer_length = 2K
    thread_stack = 64K# Don't listen on a TCP/IP port at all. This can be a security enhancement,
    # if all processes that need to connect to mysqld run on the same host.
    # All interaction with mysqld must be made via Unix sockets or named pipes.
    # Note that using this option without enabling named pipes on Windows
    # (using the "enable-named-pipe" option) will render mysqld useless!

    #skip-networking
    server-id = 1# Uncomment the following if you want to log updates
    #log-bin=C:/xampp/mysql/data/mysql-bin# Uncomment the following if you are NOT using BDB tables
    skip-bdbskip-innodb 
    # Uncomment the following if you are using InnoDB tables 
    #innodb_data_home_dir = C:/xampp/mysql/data/
    #innodb_data_file_path = ibdata1:10M:autoextend 
    #innodb_log_group_home_dir = C:/xampp/mysql/data/
    #innodb_log_arch_dir = C:/xampp/mysql/data/
    # You can set .._buffer_pool_size up to 50 - 80 % 
    # of RAM but beware of setting memory usage too high 
    #set-variable = innodb_buffer_pool_size=16M 
    #set-variable = innodb_additional_mem_pool_size=2M 
    # Set .._log_file_size to 25 % of buffer pool size 
    #set-variable = innodb_log_file_size=5M 
    #set-variable = innodb_log_buffer_size=8M 
    #innodb_flush_log_at_trx_commit=1 
    #set-variable = innodb_lock_wait_timeout=50 [mysqldump] 
    quick 
    max_allowed_packet=16M [mysql] 
    no-auto-rehash 
    # Remove the next comment character if you are not familiar with SQL 
    #safe-updates [isamchk] 
    key_buffer = 8M
    sort_buffer_size = 8M[myisamchk] 
    key_buffer = 8M
    sort_buffer_size = 8M[mysqlhotcopy] 
    interactive-timeout [WinMySQLadmin] 
    Server="C:/xampp/mysql/bin/mysqld.exe"
    #user=root
    #password=
    log-slow-queries="c:/slowquery.log"
    long_query_time=1加上双引号还是没反应,我是在windowns下用的是xampp
      

  3.   

    你的MYSQL服务是怎么启动的,启动的时候用的是哪个my.cnf ?Windows下的MYSQL一般用的是 my.ini命令行进入MYSQL后,检查一下 show variable like '%log%'; 贴出来看一下。
      

  4.   

    在mysqld选项组下面配置的
    如:
    log-slow-queries  = mysql_slow.log
    即可
      

  5.   


    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql> show variable like '%log%'
        -> ;
    ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
    corresponds to your MySQL server version for the right syntax to use near 'varia
    ble like '%log%'' at line 1
    mysql> show variable like '%log%';
    ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
    corresponds to your MySQL server version for the right syntax to use near 'varia
    ble like '%log%'' at line 1
    mysql>
      

  6.   


    mysql> show variables like '%log%';
    +---------------------------------+-----------------+
    | Variable_name                   | Value           |
    +---------------------------------+-----------------+
    | back_log                        | 50              |
    | binlog_cache_size               | 32768           |
    | expire_logs_days                | 0               |
    | innodb_flush_log_at_trx_commit  | 1               |
    | innodb_locks_unsafe_for_binlog  | OFF             |
    | innodb_log_arch_dir             |                 |
    | innodb_log_archive              | OFF             |
    | innodb_log_buffer_size          | 1048576         |
    | innodb_log_file_size            | 5242880         |
    | innodb_log_files_in_group       | 2               |
    | innodb_log_group_home_dir       |                 |
    | innodb_mirrored_log_groups      | 1               |
    | log                             | OFF             |
    | log_bin                         | OFF             |
    | log_bin_trust_function_creators | OFF             |
    | log_error                       | .\miaojihao.err |
    | log_queries_not_using_indexes   | OFF             |
    | log_slave_updates               | OFF             |
    | log_slow_queries                | OFF             |
    | log_warnings                    | 1               |
    | max_binlog_cache_size           | 4294967295      |
    | max_binlog_size                 | 1073741824      |
    | max_relay_log_size              | 0               |
    | relay_log_purge                 | ON              |
    | relay_log_space_limit           | 0               |
    | sync_binlog                     | 0               |
    +---------------------------------+-----------------+
    26 rows in set (0.00 sec)
      

  7.   

    | log_slow_queries                | OFF             |你的慢日志没有打开,贴出你的MYSQL的启动命令。估计要用用的不是这个参数文件。
      

  8.   

    win下的配置文件 不是 My.ini么?
    my.cnf是linux下的吧
      

  9.   

    less /etc/rc.d/init.d/mysql查看参数conf
      

  10.   

    我这用的是xampp集成环境安装的...