MYSQL 删除mysql-bin文件

MYSQL 开启主从同步后服务器很快空间告急了。

1.1G mysql-bin.000001
1.1G mysql-bin.000002
1.1G mysql-bin.000003
1.1G mysql-bin.000004
1.1G mysql-bin.000005
1.1G mysql-bin.000006
1.1G mysql-bin.000007
1.1G mysql-bin.000008
1.1G mysql-bin.000009
1.1G mysql-bin.000010
1.1G mysql-bin.000011
1.1G mysql-bin.000012
1.1G mysql-bin.000013
1.1G mysql-bin.000014
1.1G mysql-bin.000015
1.1G mysql-bin.000016
1.1G mysql-bin.000017

my.cnf

expire_logs_days = 3

表示保留3天的日志,这样老日志会自动被清理掉

停止主从同步,删除下面这行

log-bin=mysql-bin

强行清空mysql-bin文件

mysql> reset master;
 
mysql> reset slave;


This entry was posted in 数据库 and tagged , . Bookmark the permalink.
月小升QQ 2651044202, 技术交流QQ群 178491360
首发地址:月小升博客https://java-er.com/blog/mysql-delete-mysql-bin-file/
无特殊说明,文章均为月小升原创,欢迎转载,转载请注明本文地址,谢谢
您的评论是我写作的动力.
2020.03.24 评论已经全局关闭,有事加QQ聊天