清除mysql-bin日志文件

今天发现服务器满了,查了下发现 var/lib/mysql下占了十几个G,都是mysql-bin.0000xx文件。想了下,估计是我之前做主从服务器的时候的遗留问题。发下处理方法:

环境:CentOS 6.5

  1. 到my.conf中注释掉log-bin=mysql-bin,这样就不会再生成了,文件在/etc/下
  2. 去命令行,进入mysql(mysql -u root -p)。运行,reset master;
  3. 确认下show master logs;

具体查询硬盘使用量的代码:

du -ah . | sort -rh | head -20

注意先切换到根目录

 

This site Original article All followed" Attribution—NonCommercial—ShareAlike 4.0 (CC BY-NC-SA 4.0) ”。 Please keep the following marks for sharing and interpretation:

Original author: Jake Tao Source: 「清除mysql-bin日志文件」

Praise 108
0 0 108

Post a reply

Log in can only be commented on later
Share this page
Back to top