1.查询binlog日志文件命令:
show slave status;
show binary logs;
show master logs;
2.查询保留时间:
show variables like '%logs_days%';
3.设置保留时间:
set global expire_logs_days=1;
flush logs;
4.手动删除binlog
按日期手动删除: purge binary logs before '2020-04-22 14:00:00';
按文件名删除,删除指定文件名之前的日志:
purge binary logs to 'bin.000005';
5.LINUX上查看binlog文件占用的大小:
df -h
6.查看第一个文件日志
show binlog events;
7.查询指定文件日志
show binlog events in 'mysql-bin.000724';