How to enable MySQL Query Log?

后端 未结 14 1677
渐次进展
渐次进展 2020-11-22 09:38

How do I enable the MySQL function that logs each SQL query statement received from clients and the time that query statement has submitted? Can I do that in phpmyadmin or N

14条回答
  •  时光说笑
    2020-11-22 10:13

    On Windows you can simply go to

    C:\wamp\bin\mysql\mysql5.1.53\my.ini
    

    Insert this line in my.ini

    general_log_file = c:/wamp/logs/mysql_query_log.log
    

    The my.ini file finally looks like this

    ...
    ...
    ...    
    socket      = /tmp/mysql.sock
    skip-locking
    key_buffer = 16M
    max_allowed_packet = 1M
    table_cache = 64
    sort_buffer_size = 512K
    net_buffer_length = 8K
    read_buffer_size = 256K
    read_rnd_buffer_size = 512K
    myisam_sort_buffer_size = 8M
    basedir=c:/wamp/bin/mysql/mysql5.1.53
    log = c:/wamp/logs/mysql_query_log.log        #dump query logs in this file
    log-error=c:/wamp/logs/mysql.log
    datadir=c:/wamp/bin/mysql/mysql5.1.53/data
    ...
    ...
    ...
    ...
    

提交回复
热议问题