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:

  1. rm (to delete) or mv the slowlog to another name. (Note: mysqld will continue to write to the file, even though you changed the name.)
  2. FLUSH LOGS;. As of 5.5.3, you can limit the effect via FLUSH 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';