[root@jiucool 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.
Query OK, 0 rows
affected (8.51 sec)
mysql>
查看下mysql文件夹占用多少空间
[root@jiucool var]# du -h –max-depth=1 /usr/local/mysql/
37M /usr/local/mysql/var
70M /usr/local/mysql/mysql-test
15M /usr/local/mysql/lib
448K/usr/local/mysql/include
2.9M/usr/local/mysql/share
7.6M/usr/local/mysql/libexec
17M /usr/local/mysql/bin
11M /usr/local/mysql/docs
2.9M/usr/local/mysql/sql-bench
163M/usr/local/mysql/
整个mysql
目录占用163M大小。既然mysql-bin.0000X日志文件占用这么大空间,存在的意义又不是特别大,就不让它生成吧
[root@jiucool var]# find / -name my.cnf
找到了my.cnf 即mysql配置文件,我们将log-bin=mysql-bin
这条注释掉即可
# Replication Master Server
(default)
# binary logging is required for
replication
#log-bin=mysql-bin
重启下mysql吧.
如若满意,请点击右侧【采纳答案】,如若还有问题,请点击【追问】
希望我的回答对您有所帮助,望采纳!
~ O(∩_∩)O~
mysql的binlog日志太多了,占掉了磁盘很多空间。
binlog没有单独的目录,存放在mysql data目录里面。
可以直接用rm -rf删除,不会有什么后遗症。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)