最近清理linode的vps硬盘,吓了一跳,20G的硬盘被mysql日志给占用了,lnmp安装包默认的mysql日志是开启的,个人小网站日志也没用,禁掉吧。
修改/etc/my.cnf 文件,找到:
log-bin=mysql-bin
binlog_format=mixed
再这两行前面加上“#”将其注释掉,然后重启mysql
/etc/init.d/mysql restart
重置日志记录,执行:
/usr/local/mysql/bin/mysql -u root -p
输入mysql的密码登录后再执行:
reset master;
即可!
注:如果数据库做了主从库,请勿执行reset master;
Deletes all binary logs listed in the index file, resets the binary log index file to be empty, and creates a new binary log file.