清理binlog

自动清理10天前的binlog

expire_logs_days = 10

 

运行时添加自动清理

set global expire_logs_days = 10;

 

手动删除10天前的binlog

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