删除MySQL二进制日志(log-bin)
发布:smiling 来源: PHP粉丝网 添加日期:2014-10-08 16:23:50 浏览: 评论:0
本文章来告诉大怎么在mysql命令模式下载删除 MySQL 二进制日志(log-bin)的方法,有需要的朋友可参考.
查找当前有哪些二进制日志文件,代码如下:
- mysql> show binary logs;
- +------------------+-----------+
- | Log_name | File_size |
- +------------------+-----------+
- | mysql-bin.000001 | 1357315 |
- | mysql-bin.000002 | 117 |
- | mysql-bin.000003 | 404002 |
- | mysql-bin.000004 | 2050722 |
- | mysql-bin.000005 | 139103 |
- | mysql-bin.000006 | 46702 |
- | mysql-bin.000007 | 117 |
- | mysql-bin.000008 | 98 |
- | mysql-bin.000009 | 117 |
- | mysql-bin.000010 | 1254 |
- | mysql-bin.000011 | 117 |
- | mysql-bin.000012 | 29394942 |
- | mysql-bin.000013 | 422100 |
- | mysql-bin.000014 | 117 |
- | mysql-bin.000015 | 117 |
- | mysql-bin.000016 | 98 |
- | mysql-bin.000017 | 117 |
- | mysql-bin.000018 | 117 |
- | mysql-bin.000019 | 285300 |
- | mysql-bin.000020 | 181229 |
- | mysql-bin.000021 | 98 |
- +------------------+-----------+
- 21 rows in set (0.03 sec)
删除bin-log(删除mysql-bin.000018之前的所有二进制日志文件),代码如下:
- mysql> purge binary logs to 'mysql-bin.000018';
- Query OK, 0 rows affected (0.08 sec)
- --phpfensi.com
- mysql> show binary logs;
- +------------------+-----------+
- | Log_name | File_size |
- +------------------+-----------+
- | mysql-bin.000018 | 117 |
- | mysql-bin.000019 | 285300 |
- | mysql-bin.000020 | 181229 |
- | mysql-bin.000021 | 98 |
- +------------------+-----------+
- 4 rows in set (0.00 sec)
查看日志,代码如下:
- mysql> show binlog events;
- +------------------+-----+-------------+-----------+-------------+---------------------------------------+
- | Log_name | Pos | Event_type | Server_id | End_log_pos | Info |
- +------------------+-----+-------------+-----------+-------------+---------------------------------------+
- | mysql-bin.000018 | 4 | Format_desc | 1 | 98 | Server ver: 5.0.45-log, Binlog ver: 4 |
- | mysql-bin.000018 | 98 | Stop | 1 | 117 | |
- +------------------+-----+-------------+-----------+-------------+---------------------------------------+
- 2 rows in set (0.01 sec)
Tags: 删除二进制 MySQL二进制日志
相关文章
- ·mysql中删除二进制日志文件释放磁盘空间(2014-09-23)
- ·删除MySQL二进制日志命令与例子详解(2014-09-24)
- ·删除MySQL二进制日志具体方法(2014-10-02)
- ·mysql中设置二进制日志binlog简单操作(2014-09-23)
- ·mysql二进制日志增量备份脚本(2014-09-29)
- ·安全删除mysql主从复制二进制日志详解(2014-10-04)
推荐文章
热门文章
最新评论文章
- 写给考虑创业的年轻程序员(10)
- PHP新手上路(一)(7)
- 惹恼程序员的十件事(5)
- PHP邮件发送例子,已测试成功(5)
- 致初学者:PHP比ASP优秀的七个理由(4)
- PHP会被淘汰吗?(4)
- PHP新手上路(四)(4)
- 如何去学习PHP?(2)
- 简单入门级php分页代码(2)
- php中邮箱email 电话等格式的验证(2)