linux 服务器 usr目录用满 解决AMH面板环境mysql-bin数据库日志文件占用硬盘资源
来源:互联网 发布:大数据顾客需求 编辑:程序博客网 时间:2024/06/04 20:11
如何删除mysql-bin.0000X 日志文件呢?
红色表示输入的命令.
[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.
mysql> reset master; (清除日志文件)
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大小!OK,没问题,既然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吧.
OK,至此,操作完成. 以后再不会因为就几十M的数据库大小生成N个G的日志文件啦.
这些个日志文件太恐怖了,我搬到这新VPS来才二十天左右,还不到一个月日志文件居然就近3个G大小,如果一两个月我不清除日志文件这还得了!
- linux 服务器 usr目录用满 解决AMH面板环境mysql-bin数据库日志文件占用硬盘资源
- 解决/usr/bin/env: php: 没有那个文件或目录
- 解决/usr/bin/env: php: 没有那个文件或目录
- 解决/usr/bin/env: php: 没有那个文件或目录
- MYSQL数据库目录下Mysql-bin.0000XX日志文件的处理
- Linux目录/usr/bin和 /usr/local/bin区别
- Linux下GCC编译器链接任意目录下库文件(解决错误“/usr/bin/ld: cannot find -lxxx”)
- /etc/init.d/mysql: /usr/bin/my_print_defaults: /lib/ld-linux.so.2: bad ELF interpreter: 没有那个文件或目录
- 腾讯云服务器安装AMH控制面板
- AMH面板手工编译升级PHP5.6.9环境以及常见问题解决
- linux /usr/bin/ld cannot find 解决
- Linux /usr/bin/ld cannot find 解决
- C连接mysql数据库,报/usr/bin/ld: cannot find -lmysqlclient解决
- linux java -version显示/usr/bin/java,没有那个文件或目录
- linux下报错/usr/bin/env: node: 没有那个文件或目录
- Linux下运行Python脚本显示“: /usr/bin/env "python\r" 找不到那个文件或目录
- Linux下运行bash脚本显示“: /usr/bin/env: "bash\r": 没有那个文件或目录
- /bin,/sbin,/usr/sbin,/usr/bin 目录
- 理解LinkedHashMap
- MongoDB 学习笔记
- qt5.8的安装及c++11的配置
- 解决Ubuntu 14.04挂起后,再次唤醒后显示网络已禁用
- Spring Boot多数据源配置与使用
- linux 服务器 usr目录用满 解决AMH面板环境mysql-bin数据库日志文件占用硬盘资源
- hdu2051(stack)
- 32位Windows7系统无法启动,提示找不到“Windows\system32\config\system”文件
- 【LeetCode】数独系列
- spring IOC容器初始化和注入
- Java Volatile transient 关键字
- 数据库中树结构数据,转换为Java对象树结构( 多叉树结构 )
- 用Python实现算法导论中的算法 序
- LeetCode (Permutations II)