mysql-bin.0000*文件清理
巡检发现数据库服务器硬盘使用空间骤增,根据du -sh *命令一步一步查下来,发现是/usr/local/mysql/data目录下有大量mysql-bin.0000*文件。
登入mysql账号
#/app/mysql/bin/mysql -u root -p
Enter password: (输入密码)
Welcome to the MySQL monitor. Commands end with ; or /g.
Your MySQL connection id is 264001
Server version: 5.1.35-log Source distribution
Type ‘help;’ or ‘/h’ for help. Type ‘/c’ to clear the current input statement.
mysql> reset master; (清除日志文件)
Query OK, 0 rows affected (8.51 sec)
清除之后,硬盘占用恢复正常,检查系统页面,正常运行
确认mysql-bin日志无作用后,杜绝产生该日志。找到mysql配置文件my.cnf(find ./ -name my.cnf)
vim my.cnf
#log-bin=mysql-bin(注释掉,即不生成该日志)
重启mysql
#service mysql restart;