How to enable MySQL Query Log?

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

    This was already in a comment, but deserves its own answer: Without editing the config files: in mysql, as root, do

    SET global general_log_file='/tmp/mysql.log'; 
    SET global log_output = 'file';
    SET global general_log = on;
    

    Don't forget to turn it off afterwards:

    SET global general_log = off;
    

提交回复
热议问题