1,删除指定的日志文件名
purge master logs to "mysql-bin.000410";
2,删除2024-03-04 09:28:00时间之前的binlog
PURGE BINARY LOGS BEFORE '2024-03-04 09:28:00';
3,手动rm清理
rm -rf mysql-bin.00040*;
vim mysql-bin.log.index
清除掉里面的mysql-bin.0004**纪录
4,配置自动清理
set global expire_logs_days=5;
or
my.cnf
max_binlog_size = 500M
expire_logs_days = 15
系统自动清理
5,删除所有
RESET MASTER;
查看当前正在使用的binlog文件
show master status\G;