Does anybody know when the mysql slow log file delete slow query records?

based on my daily observation. The log file starts at 7am. I have searched for this but nothing answers me clearly. My server version if 5.6.14. Thank you.

2 Answers 2


This is probably done by your log rotation software. On my Ubuntu machine its defined in /etc/logrotate.d/mysql-server.

logrotate is run daily by a cron job. Take a look in /etc/crontab. In my case I have the following:

25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )

So daily jobs get run at 6:25AM.

I also have a file /etc/cron.daily/logrotate which configures log rotate as a daily job.

Most Linux installations would have something similar. If you're running on Windows I'm afraid I have no idea.

  • Hi Mr. Colin, Thank you very much for this. I found a separate logrotate where the slowlogs are saved in a directory. Thank you for the idea for logrotate. :) Commented Apr 10, 2015 at 6:59

Never. It just grows and grows. All the more reason to fix the slow queries.

(Or you could do something to delete the file. Of course it will come back.)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.