Ali Ali - 1 year ago 89
MySQL Question

rotating mysql slow query log

My server's MySQL slow query log is growing day by day (37 MB now) so I want to rotate it. If I move current log file to another folder then will MySQL automatically create another log file? Think of it like I am deleting current log file, so will MySQL automatically create a new one when another slow query comes?


Answer Source

You can use logrotate script to periodically rotate MySQL logs, and possibly keep a limited number of previous logs (to save space). You can configure it with any schedule you like.

Personally, I found it easy to configure using Webmin GUI

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download