1 开启事件调度器:
set global event_scheduler = 1;
2 删除10天前的binlog,并设置每天检查:
create event delete_binlog on schedule every 1 day do purge master logs before date_sub(now(),interval 10 day);
3 查看时间调度器是否生成:
select * from information_schema.events;
建议在充分测试后使用