标签:规则 inno cut lin image 主从 ble delete change
mysql-学习-8-20170522-mysql的复制



5.1 row
5.6.10 GTID
主从 row+Gtid + mysqlbinlog (smei-sync)
binary log方式: SBR, RBR,MIXED
row格式

主库通知从库我这边有变更的数据,然后从库从主库把变更的部分拉取过来,
5.7的复制有明显的提升,主要是提升了多通知方面,比如有3个slave库,会有3个进行进行分别的通知
如果是no delay模式的话,从库会从主库的内存中拉取数据
statement格式 :

主从一致性校验工具,
pt-table-checksum /pt-table-sync 都是使用的statement格式进行修复的
row格式相对statement格式而言是相对安全的,也就是说不会怎么丢数据的
delete from tb where id<10000;
row格式会都记录 而statement只记录一条 这是row和statement的区别
row格式的复制流程:

Innodb no pk 情况下有一个rowid
mixed是个过渡的形态,不建议使用了
每一个事务都有一个全局的编号,分为两部分:

实战mysql的复制,这里有7个视频,进行观看和练习操作:

创建主从的规则:
只要使用mysqldump进行备份,一定要带上下面的两个参数:
master-data
single-transaction
后面再讲为什么
主从的搭建环境梳理:
gtid改成off
记住change master语句
help change master to
给予GTID的复制,binglog必须是row格式的
SET @@GLOBAL.GTID_PURGED=‘61beeb3d-2a88-11e7-9db9-080027f7e774:1-2‘;
【管理员】吴炳锡(82565387) 22:21:06
![技术分享]()
【管理员】吴炳锡(82565387) 22:21:29
![技术分享]()
【管理员】吴炳锡(82565387) 22:22:51
![技术分享]()
【管理员】吴炳锡(82565387) 22:23:25
#mysql -S /tmp/mysql3307.sock -p </data/backup/db20170522.sql
Enter password:
ERROR 1840 (HY000) at line 24: @@GLOBAL.GTID_PURGED can only be set when @@GLOBAL.GTID_EXECUTED is empty.
【管理员】吴炳锡(82565387) 22:23:35
reset master;

mysql-学习-8-20170522-初试复制
标签:规则 inno cut lin image 主从 ble delete change
原文地址:http://www.cnblogs.com/wanggl/p/6891898.html