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

前端 未结 8 971
情歌与酒
情歌与酒 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条回答
  •  -上瘾入骨i
    2020-11-28 19:58

    Try SET GLOBAL slow_query_log = 'ON'; and perhaps FLUSH LOGS;

    This assumes you are using MySQL 5.1 or later. If you are using an earlier version, you'll need to restart the server. This is documented in the MySQL Manual. You can configure the log either in the config file or on the command line.

提交回复
热议问题