A-A+

删除MYSQl BIN-LOG 日志

2009年05月27日 未分类 暂无评论 阅读 1 次

1.查找当前有哪些二进制日志文件:
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| test               |
| wordpress          |
+--------------------+
4 rows in set (0.03 sec)

mysql> show binary logs;
+------------------+------------+
| Log_name         | File_size  |
+------------------+------------+
| mysql-bin.000001 |        106 |
| mysql-bin.000002 |        106 |
| mysql-bin.000003 |        106 |
| mysql-bin.000004 |      11244 |
| mysql-bin.000005 |        106 |
| mysql-bin.000006 |   80221410 |
| mysql-bin.000007 |        125 |
| mysql-bin.000008 |    1886693 |
| mysql-bin.000009 |        125 |
| mysql-bin.000010 | 1073811092 |
| mysql-bin.000011 | 1073786097 |
| mysql-bin.000012 | 1073856043 |
| mysql-bin.000013 | 1073852372 |
| mysql-bin.000014 | 1073864613 |
| mysql-bin.000015 |  404710612 |
+------------------+------------+
15 rows in set (0.00 sec)

mysql>21 rows in set (0.03 sec)
2.删除bin-log(删除mysql-bin.000015之前的所有二进制日志文件)
mysql> purge binary logs to 'mysql-bin.000015';
Query OK, 0 rows affected (0.08 sec)
mysql> show binary logs;
+------------------+-----------+
| Log_name         | File_size |
+------------------+-----------+
| mysql-bin.000015 | 405263128 |
+------------------+-----------+
1 row 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)

                
 

 

给我留言

Copyright © 浩然东方 保留所有权利.   Theme  Ality 07032740

用户登录