注册 登录  
 加关注
查看详情
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

记录~~~

Stay Hungry. Stay Foolish.

 
 
 

日志

 
 

binlog日志相关的一些语句  

2013-06-14 14:22:51|  分类: 数据库\mysql |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

mysql> show binlog events;
+-------------------+-----+-------------+-----------+-------------+----------------------------------------+
| Log_name | Pos | Event_type | Server_id | End_log_pos | Info |
+-------------------+-----+-------------+-----------+-------------+----------------------------------------+
| master-bin.000001 | 4 | Format_desc | 1 | 106 | Server ver: 5.1.69-log, Binlog ver: 4 |
| master-bin.000001 | 106 | Query | 1 | 194 | use `test`; insert into t1 values(11) |
| master-bin.000001 | 194 | Query | 1 | 283 | use `test`; insert into t1 values(112) |
| master-bin.000001 | 283 | Query | 1 | 357 | use `test`; truncate t1 |
| master-bin.000001 | 357 | Query | 1 | 445 | use `test`; insert into t1 values (3) |
| master-bin.000001 | 445 | Query | 1 | 534 | use `test`; insert into t1 values (32) |
| master-bin.000001 | 534 | Rotate | 1 | 578 | master-bin.000002;pos=4 |
+-------------------+-----+-------------+-----------+-------------+----------------------------------------+
7 rows in set (0.00 sec)

mysql>


mysql> show binlog events in 'master-bin.000002';
+-------------------+-----+-------------+-----------+-------------+---------------------------------------+
| Log_name | Pos | Event_type | Server_id | End_log_pos | Info |
+-------------------+-----+-------------+-----------+-------------+---------------------------------------+
| master-bin.000002 | 4 | Format_desc | 1 | 106 | Server ver: 5.1.69-log, Binlog ver: 4 |
+-------------------+-----+-------------+-----------+-------------+---------------------------------------+
1 row in set (0.00 sec)


mysql> flush logs;//产生新的binlog文件

==========================

mysql> show binary logs;
+-------------------+-----------+
| Log_name | File_size |
+-------------------+-----------+
| master-bin.000001 | 578 |
| master-bin.000002 | 196 |
+-------------------+-----------+
2 rows in set (0.00 sec)

mysql>


mysql> show binlog events from 194;
+-------------------+-----+------------+-----------+-------------+----------------------------------------+
| Log_name | Pos | Event_type | Server_id | End_log_pos | Info |
+-------------------+-----+------------+-----------+-------------+----------------------------------------+
| master-bin.000001 | 194 | Query | 1 | 283 | use `test`; insert into t1 values(112) |
| master-bin.000001 | 283 | Query | 1 | 357 | use `test`; truncate t1 |
| master-bin.000001 | 357 | Query | 1 | 445 | use `test`; insert into t1 values (3) |
| master-bin.000001 | 445 | Query | 1 | 534 | use `test`; insert into t1 values (32) |
| master-bin.000001 | 534 | Rotate | 1 | 578 | master-bin.000002;pos=4 |
+-------------------+-----+------------+-----------+-------------+----------------------------------------+
5 rows in set (0.00 sec)

mysql>


reset master;
show master status;
show slave status;
  评论这张
 
阅读(177)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018