Delete Slow Query Log File
As of 5.5.3, FLUSH LOGS
will close and reopen the slowlog. (In old versions, FLUSH
had no effect on the slowlog.)
So, on *nix OS, this should work without restarting the server:
rm
(to delete) ormv
the slowlog to another name. (Note: mysqld will continue to write to the file, even though you changed the name.)FLUSH LOGS;
. As of 5.5.3, you can limit the effect viaFLUSH SLOW LOGS;
See http://bugs.mysql.com/bug.php?id=14104 and http://bugs.mysql.com/bug.php?id=60878
I would not turn off the slowlog -- next month someone will add a naughty query and you will want to know about it.
or set
SET GLOBAL slow_query_log = 'OFF';
then clear the file and then
SET GLOBAL slow_query_log = 'ON';