删除10天前的MySQL binlog日志

PURGE MASTER LOGS BEFORE DATE_SUB(CURRENT_DATE, INTERVAL 10 DAY);
show master logs;

删除所有MySQL binlog日志

reset master;

实例:

//清除MySQL-bin.010日志:
PURGE MASTER LOGS TO 'MySQL-bin.010';
//清除2018-06-22 13:00:00前binlog日志:
PURGE MASTER LOGS BEFORE '2018-06-22 13:00:00';
//清除3天前binlog日志BEFORE,变量的date自变量可以为'YYYY-MM-DD hh:mm:ss'格式:
PURGE MASTER LOGS BEFORE DATE_SUB( NOW( ), INTERVAL 3 DAY);