Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2518133
  • 博文数量: 540
  • 博客积分: 11289
  • 博客等级: 上将
  • 技术积分: 6160
  • 用 户 组: 普通用户
  • 注册时间: 2008-02-11 20:27
个人简介

潜龙勿用,见龙在田

文章分类

全部博文(540)

文章存档

2018年(2)

2013年(5)

2012年(24)

2011年(104)

2010年(60)

2009年(217)

2008年(128)

分类: LINUX

2009-04-30 14:25:24

1.查找当前有哪些二进制日志文件:
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)

2.删除bin-log(删除mysql-bin.000018之前的所有二进制日志文件)

mysql> purge binary logs to 'mysql-bin.000018';
Query OK, 0 rows affected (0.08 sec)

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)

阅读(2044) | 评论(0) | 转发(0) |
0

上一篇:工具介绍

下一篇:Ubuntu/Debian下载

给主人留下些什么吧!~~