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

前端 未结 8 973
情歌与酒
情歌与酒 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 19:57

    I think the problem is making sure that MySQL server has the rights to the file and can edit it.

    If you can get it to have access to the file, then you can try setting:
    SET GLOBAL slow_query_log = 1;

    If not, you can always 'reload' the server after changing the configuration file. On linux its usually /etc/init.d/mysql reload

提交回复
热议问题