patternsqlModerate
Delete Slow Query Log File
Viewed 0 times
filedeletelogqueryslow
Problem
I was logging slow queries of my system. Now I have few queries to be optimized and reset the global
I am using Cent OS and do not want to delete or affect other log files (i.e. general log or binary log)
Thanks.
slow_query_log variable to 0. Now I want to delete slow query log file mysqld-slow.log. can anyone tell me what is the standard way to do this ?I am using Cent OS and do not want to delete or affect other log files (i.e. general log or binary log)
Thanks.
Solution
As of 5.5.3,
So, on *nix OS, this should work without restarting the server:
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.
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) ormvthe 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.
Context
StackExchange Database Administrators Q#146943, answer score: 10
Revisions (0)
No revisions yet.