处理删除二进制日志后,show binary logs 显示File_size为0的情况
发表于:2025-01-20 作者:千家信息网编辑
千家信息网最后更新 2025年01月20日,服务器硬盘空间占用过大,发现二进制日志文件过多,于是删除mysql的二进制日志文件:[root@iZbp1b36sef813d0zilqd6Z mysql] # rm -rf dbbin.00010*
千家信息网最后更新 2025年01月20日处理删除二进制日志后,show binary logs 显示File_size为0的情况
服务器硬盘空间占用过大,发现二进制日志文件过多,于是删除mysql的二进制日志文件:
[root@iZbp1b36sef813d0zilqd6Z mysql] # rm -rf dbbin.00010*[root@iZbp1b36sef813d0zilqd6Z mysql] # rm -rf dbbin.00010*[root@iZbp1b36sef813d0zilqd6Z mysql] # rm -rf dbbin.00011*[root@iZbp1b36sef813d0zilqd6Z mysql] # rm -rf dbbin.00012*
然后通过mysql命令行查看:
mysql> show binary logs;+--------------+------------+| Log_name | File_size |+--------------+------------+| dbbin.000001 | 0 || dbbin.000002 | 0 || dbbin.000003 | 0 || dbbin.000004 | 0 || dbbin.000005 | 0 || dbbin.000006 | 0 || dbbin.000007 | 0 || dbbin.000008 | 0 || dbbin.000009 | 0 || dbbin.000010 | 0 || dbbin.000011 | 0 || dbbin.000012 | 0 || dbbin.000013 | 0 || dbbin.000014 | 0 || dbbin.000015 | 0 || dbbin.000016 | 0 || dbbin.000017 | 0 || dbbin.000018 | 0 || dbbin.000019 | 0 || dbbin.000020 | 0 || dbbin.000021 | 0 || dbbin.000022 | 0 || dbbin.000023 | 0 || dbbin.000024 | 0 || dbbin.000025 | 0 || dbbin.000026 | 0 || dbbin.000027 | 0 || dbbin.000028 | 0 || dbbin.000029 | 0 || dbbin.000030 | 0 || dbbin.000031 | 0 || dbbin.000032 | 0 || dbbin.000033 | 0 || dbbin.000034 | 0 || dbbin.000035 | 0 || dbbin.000036 | 0 || dbbin.000037 | 0 || dbbin.000038 | 0 || dbbin.000039 | 0 || dbbin.000040 | 0 || dbbin.000041 | 0 || dbbin.000042 | 0 || dbbin.000043 | 0 || dbbin.000044 | 0 || dbbin.000045 | 0 || dbbin.000046 | 0 || dbbin.000047 | 0 || dbbin.000048 | 0 || dbbin.000049 | 0 || dbbin.000050 | 0 || dbbin.000051 | 0 || dbbin.000052 | 0 || dbbin.000053 | 0 || dbbin.000054 | 0 || dbbin.000055 | 0 || dbbin.000056 | 0 || dbbin.000057 | 0 || dbbin.000058 | 0 || dbbin.000059 | 0 || dbbin.000060 | 0 || dbbin.000061 | 0 || dbbin.000062 | 0 || dbbin.000063 | 0 || dbbin.000064 | 0 || dbbin.000065 | 0 || dbbin.000066 | 0 || dbbin.000067 | 0 || dbbin.000068 | 0 || dbbin.000069 | 0 || dbbin.000070 | 0 || dbbin.000071 | 0 || dbbin.000072 | 0 || dbbin.000073 | 0 || dbbin.000074 | 0 || dbbin.000075 | 0 || dbbin.000076 | 0 || dbbin.000077 | 0 || dbbin.000078 | 0 || dbbin.000079 | 0 || dbbin.000080 | 0 || dbbin.000081 | 0 || dbbin.000082 | 0 || dbbin.000083 | 0 || dbbin.000084 | 0 || dbbin.000085 | 0 || dbbin.000086 | 0 || dbbin.000087 | 0 || dbbin.000088 | 0 || dbbin.000089 | 0 || dbbin.000090 | 0 || dbbin.000091 | 0 || dbbin.000092 | 0 || dbbin.000093 | 0 || dbbin.000094 | 0 || dbbin.000095 | 0 || dbbin.000096 | 0 || dbbin.000097 | 0 || dbbin.000098 | 0 || dbbin.000099 | 0 || dbbin.000100 | 0 || dbbin.000101 | 0 || dbbin.000102 | 0 || dbbin.000103 | 0 || dbbin.000104 | 0 || dbbin.000105 | 0 || dbbin.000106 | 0 || dbbin.000107 | 0 || dbbin.000108 | 0 || dbbin.000109 | 0 || dbbin.000110 | 0 || dbbin.000111 | 0 || dbbin.000112 | 0 || dbbin.000113 | 0 || dbbin.000114 | 0 || dbbin.000115 | 0 || dbbin.000116 | 0 || dbbin.000117 | 0 || dbbin.000118 | 0 || dbbin.000119 | 0 || dbbin.000120 | 0 || dbbin.000121 | 0 || dbbin.000122 | 0 || dbbin.000123 | 0 || dbbin.000124 | 0 || dbbin.000125 | 0 || dbbin.000126 | 0 || dbbin.000127 | 0 || dbbin.000128 | 0 || dbbin.000129 | 0 || dbbin.000130 | 0 || dbbin.000131 | 0 || dbbin.000001 | 0 || dbbin.000002 | 0 || dbbin.000003 | 0 || dbbin.000004 | 0 || dbbin.000005 | 0 || dbbin.000006 | 0 || dbbin.000007 | 0 || dbbin.000008 | 0 || dbbin.000009 | 0 || dbbin.000010 | 0 || dbbin.000011 | 0 || dbbin.000012 | 0 || dbbin.000013 | 0 || dbbin.000014 | 0 || dbbin.000015 | 0 || dbbin.000016 | 0 || dbbin.000017 | 0 || dbbin.000018 | 0 || dbbin.000019 | 0 || dbbin.000020 | 0 || dbbin.000021 | 0 || dbbin.000022 | 0 || dbbin.000023 | 0 || dbbin.000024 | 0 || dbbin.000025 | 0 || dbbin.000026 | 0 || dbbin.000027 | 0 || dbbin.000028 | 0 || dbbin.000029 | 0 || dbbin.000030 | 0 || dbbin.000031 | 0 || dbbin.000032 | 0 || dbbin.000033 | 0 || dbbin.000034 | 0 || dbbin.000035 | 0 || dbbin.000036 | 0 || dbbin.000037 | 0 || dbbin.000038 | 0 || dbbin.000039 | 0 || dbbin.000040 | 0 || dbbin.000041 | 0 || dbbin.000042 | 0 || dbbin.000043 | 0 || dbbin.000044 | 0 || dbbin.000045 | 0 || dbbin.000046 | 0 || dbbin.000047 | 0 || dbbin.000048 | 0 || dbbin.000049 | 0 || dbbin.000050 | 0 || dbbin.000051 | 0 || dbbin.000052 | 0 || dbbin.000053 | 0 || dbbin.000054 | 0 || dbbin.000055 | 0 || dbbin.000056 | 0 || dbbin.000057 | 0 || dbbin.000058 | 0 || dbbin.000059 | 0 || dbbin.000060 | 0 || dbbin.000061 | 0 || dbbin.000062 | 0 || dbbin.000063 | 0 || dbbin.000064 | 0 || dbbin.000065 | 0 || dbbin.000066 | 0 || dbbin.000067 | 0 || dbbin.000068 | 0 || dbbin.000069 | 0 || dbbin.000070 | 0 || dbbin.000071 | 0 || dbbin.000072 | 0 || dbbin.000073 | 0 || dbbin.000074 | 0 || dbbin.000075 | 0 || dbbin.000076 | 0 || dbbin.000077 | 0 || dbbin.000078 | 0 || dbbin.000079 | 0 || dbbin.000080 | 0 || dbbin.000081 | 0 || dbbin.000082 | 0 || dbbin.000083 | 0 || dbbin.000084 | 0 || dbbin.000085 | 0 || dbbin.000086 | 0 || dbbin.000087 | 0 || dbbin.000088 | 0 || dbbin.000089 | 0 || dbbin.000090 | 0 || dbbin.000091 | 0 || dbbin.000092 | 0 || dbbin.000093 | 0 || dbbin.000094 | 0 || dbbin.000095 | 0 || dbbin.000096 | 0 || dbbin.000097 | 0 || dbbin.000098 | 0 || dbbin.000099 | 0 || dbbin.000100 | 0 || dbbin.000101 | 0 || dbbin.000102 | 0 || dbbin.000103 | 0 || dbbin.000104 | 0 || dbbin.000105 | 0 || dbbin.000106 | 0 || dbbin.000107 | 0 || dbbin.000108 | 0 || dbbin.000109 | 0 || dbbin.000110 | 0 || dbbin.000111 | 0 || dbbin.000112 | 0 || dbbin.000113 | 0 || dbbin.000114 | 0 || dbbin.000115 | 0 || dbbin.000116 | 0 || dbbin.000117 | 0 || dbbin.000118 | 0 || dbbin.000119 | 0 || dbbin.000120 | 0 || dbbin.000121 | 0 || dbbin.000122 | 0 || dbbin.000123 | 0 || dbbin.000124 | 0 || dbbin.000125 | 0 || dbbin.000126 | 0 || dbbin.000127 | 0 || dbbin.000128 | 0 || dbbin.000129 | 0 || dbbin.000130 | 0 || dbbin.000131 | 0 || dbbin.000132 | 0 || dbbin.000133 | 0 || dbbin.000134 | 0 || dbbin.000135 | 928716703 || dbbin.000136 | 959380747 || dbbin.000137 | 851723423 || dbbin.000138 | 365674634 || dbbin.000139 | 1073742052 || dbbin.000140 | 123579443 || dbbin.000141 | 30362973 || dbbin.000142 | 902470948 || dbbin.000143 | 889738300 || dbbin.000144 | 923650782 || dbbin.000145 | 1511748108 || dbbin.000146 | 290317434 || dbbin.000147 | 52264 |+--------------+------------+278 rows in set (0.00 sec)
看着很不爽,进行下一步的解决:
mysql> purge binary logs to 'dbbin.000133';Query OK, 0 rows affected, 263 warnings (0.01 sec)
查看处理的结果:
mysql> show binary logs;+--------------+------------+| Log_name | File_size |+--------------+------------+| dbbin.000133 | 0 || dbbin.000134 | 0 || dbbin.000135 | 928716703 || dbbin.000136 | 959380747 || dbbin.000137 | 851723423 || dbbin.000138 | 365674634 || dbbin.000139 | 1073742052 || dbbin.000140 | 123579443 || dbbin.000141 | 30362973 || dbbin.000142 | 902470948 || dbbin.000143 | 889738300 || dbbin.000144 | 923650782 || dbbin.000145 | 1511748108 || dbbin.000146 | 290317434 || dbbin.000147 | 3826433 |+--------------+------------+15 rows in set (0.00 sec)
再处理一下:
mysql> purge binary logs to 'dbbin.000135';Query OK, 0 rows affected, 1 warning (0.01 sec)
mysql> show binary logs;+--------------+------------+| Log_name | File_size |+--------------+------------+| dbbin.000135 | 928716703 || dbbin.000136 | 959380747 || dbbin.000137 | 851723423 || dbbin.000138 | 365674634 || dbbin.000139 | 1073742052 || dbbin.000140 | 123579443 || dbbin.000141 | 30362973 || dbbin.000142 | 902470948 || dbbin.000143 | 889738300 || dbbin.000144 | 923650782 || dbbin.000145 | 1511748108 || dbbin.000146 | 290317434 || dbbin.000147 | 4443351 |+--------------+------------+13 rows in set (0.00 sec)
看着是不是舒服很多?
二进制
日志
处理
文件
舒服
命令
服务器
硬盘
空间
结果
过多
服务
情况
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
宁畅服务器定制市场
山东云服务器租用价格表云空间
oracle数据库用户拷贝
未成年网络安全课件
硬盘和cpu能装服务器吗
中国电信网络安全高科技
东莞市网络技术类招聘信息
龙岗软件开发哪家公司便宜点
手游 服务器架构
网络安全应急演练工作总结
银行国家网络安全周宣传总结
怎么启动web服务器
深圳网络安全员试题
无限分类数据库
网络安全设备如何提升
上海知名服务器应用范围
数据库日期怎么获取java
制定网络安全规则的上市公司
数据库的最基本单位
惠州市网络技术 培训班
好创意软件开发如何找投资
怀旧服怎么重新下载服务器
jsp增删改查数据库
网络安全维护工资高吗
当今网络安全主要特点是整体的
监控保存多长时间网络安全法
西安软件开发培训教育机构
郑州云光软件开发有限公司
茶队是哪个服务器
提升自身的网络安全意识