mysql 5.1 – turning on/off query logging on the fly

i dont run query logging – more to avoid running out of the disk space on /var/log than for the performance reasons. but from time to time it’s good to be able to turn logging on to see what’s going on. in 5.1 and later versions it’s possible without restarting the mysqld.

to turn it on:

set global general_log = 'off';  set global general_log_file = '/var/log/mysql/mysql.log'; set global general_log = 'on';

to turn it off:

set global general_log = 'off';  

Leave a Reply

Your email address will not be published. Required fields are marked *

(Spamcheck Enabled)