on MySQL Gtid

Source: Internet
Author: User
Tags uuid

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.