What is Gtid
What is Gtid, in short, is the global transaction ID (transaction identifier)
The format of the Gtid is similar to the following:
7a07cd08-ac1b-11e2-9fcf-0010184e9e08:1
Gtid is actually made up of Uuid+tid. Where the UUID is the unique identity of a MySQL instance. The TID represents the number of transactions that have been committed on the instance and is monotonically incremented as the transaction commits.
Why do I need it?
Use change master to no longer need to find the location of Binlog and Positon, MySQL automatically find synchronization via Gtid
Gtid's workflow is like this.
1 master last transaction committed and written to Binlog
2 Binlog log sent to Slave,slave accepts and writes relay log relay log, slave reads to this gtid,
and set the value of the Gtid_next
SET @ @session. gtid_next=
3 slave check and confirm that this gtid is not being used and write to your own binlog
1 Configuring Gtid Replication
Gtid-mode=on
Enforce-gtid-consistency=true
Log-slave-updates=1
Log-bin=mysql-bin
Binlog_format = row
2 Export on Master
mysql-uroot-p123456--single-transaction-r-e--triggers-b yourdb > Bak.sql
3 Importing on slave
myql-uroot-p123 < Bak.sql
4 then do point again
Change Master to Master_host =,master_port =, Master_user = Repl-user,master_password =, master_auto_position = 1;
This article is from the DBA Sky blog, so be sure to keep this source http://9425473.blog.51cto.com/9415473/1661517
on MySQL Gtid