Bug #3337 Option to clear the query log without shutting down the server
Submitted: 30 Mar 2004 10:33 Modified: 7 Oct 2005 22:23
Reporter: Gilles Levreau Email Updates:
Status: Closed Impact on me:
Category:MySQL Server Severity:S4 (Feature request)
Version:4.x OS:Windows (Windows)
Assigned to: CPU Architecture:Any

[30 Mar 2004 10:33] Gilles Levreau
It would be nice to have the option to clear the general query log without having to shut down the server. Shutting down the server is not always an available or convenient option, and the query log is growing very quickly in size.

Some command like the 'flush logs' but that operates on the query log instead of the error log would be great.

How to repeat:
To enable the general query log, add this line to the mysqld section in the option file (my.cnf, ...), or start the server with the --log command-line parameter:

[30 Jun 2004 19:42] Bruce Bristol
In Unix you can do cat /dev/null > logfile and that'll clear it out.

You may be able to open a command window in Windows and do type nul > logfile

Not sure how that'll work in Windows with the file open.  Good luck!
[7 Oct 2005 22:23] Hartmut Holzgraefe
FLUSH LOGS should help you with this