// Metadata created by nebel
//

[id="enable-mysql-gtids-for-cdc_{context}"]
= Enabling MySQL Global Transaction Identifiers for {prodname}

Global transaction identifiers (GTIDs) uniquely identify transactions that occur on a server within a cluster. Though not required for the {prodname} MySQL connector, using GTIDs simplifies replication and allows you to more easily confirm if master and slave servers are consistent.

NOTE: GTIDs are only available from MySQL 5.6.5 and later. See the link:https://dev.mysql.com/doc/refman/{mysql-version}/en/replication-options-gtids.html#option_mysqld_gtid-mode[MySQL documentation] for more details.

.Prerequisites

* You must have a MySQL server.
* You must know basic SQL commands.
* You must have access to the MySQL configuration file.

.Procedure

. Enable `gtid_mode`:
[source,SQL]
----
mysql> gtid_mode=ON
----

[start=2]
. Enable `enforce_gtid_consistency`:
[source,SQL]
----
mysql> enforce_gtid_consistency=ON
----

[start=3]
. Confirm the changes:
[source,SQL]
----
mysql> show global variables like '%GTID%';
----

.response
[source,SQL]
----
+--------------------------+-------+
| Variable_name            | Value |
+--------------------------+-------+
| enforce_gtid_consistency | ON    |
| gtid_mode                | ON    |
+--------------------------+-------+
----

== Options explained

[cols="3,7"]
|===
|Permission/item |Description

|``gtid_mode``
a| Boolean which specifies whether GTID mode of the MySQL server is enabled or not.

* `ON` = enabled
* `OFF` = disabled

|`enforce_gtid_consistency`
a| Boolean which instructs the server whether or not to enforce GTID consistency by allowing the execution of statements that can be logged in a transactionally safe manner; required when using GTIDs.

* `ON` = enabled
* `OFF` = disabled

|===
