如何删除mysql-bin.0000X 日志文件
今天发现云服务器空间几乎满了,没什么东西啊,发现是数据库日志文件占用了,那么就清除吧,留下记录备用
如何删除mysql-bin.0000X 日志文件呢?
如何删除mysql-bin.0000X 日志文件呢?
红色表示输入的命令.
[root@hl05 var]# /usr/local/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>
既然mysql-bin.0000X日志文件占用这么大空间,存在的意义又不是特别大,那么我们就不让它生成吧.
[root@hl05 var]# find / -name my.cnf
找到了my.cnf 即mysql配置文件如/etc/my.cnf,我们将log-bin=mysql-bin 这条注释掉即可.# Replication Master Server (default)
# binary logging is required for replication
#log-bin=mysql-bin
重启下mysql吧.
[root@hl05 var]# /etc/init.d/mysql restart
扫描二维码,手机查看
声明:本文来源于互联网,观点仅代表作者本人,不代表欢乐你我,真实性请妥善甄别。