How can I enable MySQL's slow query log without restarting MySQL?

前端 未结 8 997
情歌与酒
情歌与酒 2020-11-28 19:44

I followed the instructions here: http://crazytoon.com/2007/07/23/mysql-changing-runtime-variables-with-out-restarting-mysql-server/ but that seems to only set the threshold

8条回答
  •  伪装坚强ぢ
    2020-11-28 20:10

    If you want to enable general error logs and slow query error log in the table instead of file

    To start logging in table instead of file:

    set global log_output = “TABLE”;
    

    To enable general and slow query log:

    set global general_log = 1;
    set global slow_query_log = 1;
    

    To view the logs:

    select * from mysql.slow_log;
    select * from mysql.general_log;
    

    For more details visit this link

    http://easysolutionweb.com/technology/mysql-server-logs/

提交回复
热议问题