清理bin-log日志(mysql-bin日志清理)
2014-10-27 11:24
274 查看
清理bin-log日志(mysql-bin日志清理),主从复制中的机器不要使用此方法。
1.查看档案
mysql> show binary logs;
+----------------+-----------+
| Log_name | File_size |
+----------------+-----------+
| ablelee.000001 | 150462942 |
| ablelee.000002 | 125 |
| ablelee.000003 | 106 |
+----------------+-----------+
2.删除bin-log(删除ablelee.000003之前的而没有包含ablelee.000003)
mysql> purge binary logs to 'ablelee.000003';
Query OK, 0 rows affected (0.16 sec)
3. 查询结果(现在只有一条记录了.)
mysql> show binlog events\G
*************************** 1. row ***************************
Log_name: ablelee.000003
Pos: 4
Event_type: Format_desc
Server_id: 1
End_log_pos: 106
Info: Server ver: 5.1.26-rc-log, Binlog ver: 4
1 row in set (0.01 sec)
(ablelee.000001和ablelee.000002已被删除)
mysql> show binary logs;
+----------------+-----------+
| Log_name | File_size |
+----------------+-----------+
| ablelee.000003 | 106 |
+----------------+-----------+
1 row in set (0.00 sec)
1.查看档案
mysql> show binary logs;
+----------------+-----------+
| Log_name | File_size |
+----------------+-----------+
| ablelee.000001 | 150462942 |
| ablelee.000002 | 125 |
| ablelee.000003 | 106 |
+----------------+-----------+
2.删除bin-log(删除ablelee.000003之前的而没有包含ablelee.000003)
mysql> purge binary logs to 'ablelee.000003';
Query OK, 0 rows affected (0.16 sec)
3. 查询结果(现在只有一条记录了.)
mysql> show binlog events\G
*************************** 1. row ***************************
Log_name: ablelee.000003
Pos: 4
Event_type: Format_desc
Server_id: 1
End_log_pos: 106
Info: Server ver: 5.1.26-rc-log, Binlog ver: 4
1 row in set (0.01 sec)
(ablelee.000001和ablelee.000002已被删除)
mysql> show binary logs;
+----------------+-----------+
| Log_name | File_size |
+----------------+-----------+
| ablelee.000003 | 106 |
+----------------+-----------+
1 row in set (0.00 sec)
相关文章推荐
- Linux-Shell:mysql的bin_log日志清理
- 自动清理过期mysql从库 log_bin日志
- 删除MySQL log bin 日志操作记录
- MySQL 用户授权和bin-log日志和主从复制、读写分离(1)
- mysql二进制日志(bin-log)配置及相关操作
- Mysql:开启了二进制日志功能 log-bin 的mysql数据库, 如何故障恢复?
- MySQL的log-bin的日志功能
- 在开启bin-log日志下Mysql报错
- mysql的mysql-bin日志清理
- mysql的mysql-bin日志清理
- MySQL的log-bin的日志功能
- mysql清除log-bin日志的方法
- MySQL的log-bin的日志功能
- Ubuntu下开启mysql的bin_log日志
- MySQL用户授权 和 bin-log日志 详解和实战
- MySQL的log-bin的日志功能
- 恐怖的MySql-bin.0000X日志文件(转http://www.jiucool.com/terror-mysql-bin-0000x-log-file/)
- 开启bin-log日志mysql报错的解决方法
- mysql 关闭 log-bin 日志
- mysql中bin-log日志操作常用命令