How to enable MySQL Query Log?

后端 未结 14 1656
渐次进展
渐次进展 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:24

    To enable the query log in MAC Machine:

    Open the following file:

    vi /private/etc/my.cnf
    

    Set the query log url under 'mysqld' section as follows:

    [mysqld]
    
    general_log_file=/Users/kumanan/Documents/mysql_query.log
    

    Few machine’s are not logging query properly, So that case you can enable it from MySQL console

    mysql> SET global general_log = 1;
    

提交回复
热议问题