首页> 知识分享 >其它分享 其它分享

MYSQL主从断网恢复复制的问题(2)

作者:小萝卜 2019-05-30 浏览 1121

简介使用change master to命令,需要知道MASTER_LOG_POS位置。用SHOW MASTER STATUS查看

MYSQL主从断网恢复复制的问题(2) (2010-04-29 23:29:13)转载▼

标签: it 分类: mysql

使用change master to命令,需要知道MASTER_LOG_POS位置。

用SHOW MASTER STATUS查看

mysql> show master status;

+—————————-+—————+———————+—————————+

| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |

+—————————-+—————+———————+—————————+

| mysql51log.000001 | 5675 | cpcdb | |

+—————————-+—————+———————+—————————+

1 row in set (0.00 sec)

mysql> insert into t1 values(4,6);

Query OK, 1 row affected (0.09 sec)

mysql> show master status;

+—————————-+—————+———————+—————————+

| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |

+—————————-+—————+———————+—————————+

| mysql51log.000001 | 5861 | cpcdb | |

+—————————-+—————+———————+—————————+

1 row in set (0.00 sec)

从上面可以看到,插入一条记录后,Position位置发生了改变,在网络断开,但又进行了数据操作的情况下,得到Position后,再使用CHANGE MASTER TO命令,指定最后的Position值,就可以同步数据了

 

 

很赞哦! (0)

文章评论

    高端网站建设