From 93f39cc8dc1d50552d7f1604209801e204eab743 Mon Sep 17 00:00:00 2001 From: Chris Burgess <chris@giantrobot.co.nz> Date: Thu, 30 Mar 2017 18:44:21 +1300 Subject: [PATCH] Add runtime settings for query log. --- docs/dev-tools/debugging.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/dev-tools/debugging.md b/docs/dev-tools/debugging.md index 90870f6a..e4ffa144 100644 --- a/docs/dev-tools/debugging.md +++ b/docs/dev-tools/debugging.md @@ -94,6 +94,21 @@ The relevant settings are: general_log_file=/tmp/mysql.log # Enable/disable the query log general_log=1 + +You can enable the query log at runtime via SQL, provided the path to the logfile is configured. + + SET GLOBAL general_log = 'ON'; + SET GLOBAL general_log = 'OFF'; + +And you can inspect the query log settings also: + + mysql> show variables like '%general%'; + +------------------+---------------------------------+ + | Variable_name | Value | + +------------------+---------------------------------+ + | general_log | OFF | + | general_log_file | /usr/local/var/mysql/strike.log | + +------------------+---------------------------------+ ## Changing source code -- GitLab