Clean up binlog files

If you care having disk space issues because your MySQL bin logs are too big you can delete older ones using this simple MySQL query:

PURGE BINARY LOGS BEFORE NOW() – INTERVAL 21 DAY;

This example will keep 21 days of binlogs, set the interval as needed. Btw, if you are using MySQL replication, this command will not be replicated (good!).

Clean up binlog files
Share this