# Gtid Related configuration:
enforce_gtid_consistency = true # force Gtid performed check must be on (static parameter) disable-gtid-unsafe-statementsHttp://imysql.cn/2012/09/21/mysql-faq-can-not-login-after-new-install.html
Gtid_mode = on # turn on Gtid copy (static parameter)
log_slave_updates = true # writes the statement to the binary log
binlog_format = row # row mode replication, recommended line mode (dynamic parameter)
binlog_row_image = minimal # row copy mode, minimum copy mode (dynamic parameter)
# Turn on copy mode
stop slave;
Change master to master_host= ' 192.168.1.95 ', master_user= ' repl ', master_password= '[email protected]', master_auto_position=1;
start slave;
# Handling of error problems in Gtid mode
Way One:
stop slave;
reset Master; # causes the gtid_executed variable to become empty
set global gtid_purged= ' 29f5e5d6-0e58-11e5-ab0f-00163e634e89:1-22108 '; #这个gtid is the Gtid to perform an error from the library
start slave;
Way Two: (The official recommended way)
stop slave;
SET SESSION gtid_next = ' 9ba6eccd-0e56-11e5-ab05-00163e027dd7:1 ';
BEGIN; COMMIT;
SET SESSION gtid_next = AUTOMATIC;
START SLAVE;
# Gtid Restrictions: # # Gtid Related bugs
1.create Table TT select * from t1; #
2. Temporary tables cannot be created inside a transaction create temporary table TT (ID int, iname varchar )
Reference Documentation:
http://dwchaoyue.blog.51cto.com/2826417/1559764
This article is from the "SQL Server MySQL" blog, so be sure to keep this source http://dwchaoyue.blog.51cto.com/2826417/1840525
Configuration and maintenance of MySQL 5.6 Gtid