Common SQL Errors

MySQL Error 3115: ER_CANT_REPLICATE_GTID_WITH_GTID_MODE_OFF - How to Fix and Prevent

Galaxy Team
August 8, 2025

Error 3115 occurs when a server tries to replicate a GTID transaction while GTID_MODE is OFF.

Sign up for the latest in common SQL errors from the Galaxy Team!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

What is MySQL error code 3115?

ER_CANT_REPLICATE_GTID_WITH_GTID_MODE_OFF is MySQL error 3115 indicating the replica received a GTID transaction, but the server runs with GTID_MODE=OFF. Turn GTID_MODE to ON or switch replication to non-GTID to resolve.

Error Highlights

Typical Error Message

ER_CANT_REPLICATE_GTID_WITH_GTID_MODE_OFF

Error Type

Replication Error

Language

MySQL

Symbol

#ERROR!

Error Code

3115

SQL State

HY000

Explanation

Table of Contents

What is MySQL error 3115 ER_CANT_REPLICATE_GTID_WITH_GTID_MODE_OFF?

Error 3115 fires when a MySQL replica running with GTID_MODE=OFF receives a binary log event that contains a GTID. Because GTID transactions require global transaction identifiers, the server refuses to apply the event and stops replication.

The error halts the SQL thread, leaving the replica out of sync until GTID handling is enabled or the offending event is skipped.

What Causes This Error?

The primary trigger is a configuration mismatch: the source uses GTID_MODE=ON while the replica was started or restarted with GTID_MODE=OFF.

It can also appear after restoring a logical backup containing SET @@SESSION.GTID_NEXT statements into a non-GTID server.

How to Fix ER_CANT_REPLICATE_GTID_WITH_GTID_MODE_OFF

Most administrators resolve the error by enabling GTID_MODE on the replica and restarting replication. This aligns the server with the source and allows GTID events to apply.

Alternatively, convert replication to traditional binlog position-based mode by clearing GTID_EXECUTED on the source and replica and re-configuring CHANGE MASTER TO with MASTER_AUTO_POSITION=0.

Common Scenarios and Solutions

Upgrading a replica without copying my.cnf changes often leaves GTID_MODE disabled. Double-check the configuration file and enable GTID settings before starting mysqld.

Cloning production data to a test server that has GTID disabled will raise the error on the first GTID transaction. Enable GTID or strip GTID statements during import.

Best Practices to Avoid This Error

Maintain identical GTID_MODE settings across all servers in a replication topology.

Automate configuration validation with startup scripts or monitoring tools that alert when GTID_MODE differs between source and replicas.

Related Errors and Solutions

Error 1782: ER_GTID_MODE_OFF raises during SET @@GLOBAL.GTID_MODE=ON without proper preconditions. Ensure log_bin is enabled and server_uuid exists.

Error 1236: ER_BINLOG_READ_ERROR occurs when replicas cannot read binary logs, often after purging logs needed for GTID replication.

Common Causes

Source uses GTID, replica does not

The most frequent cause is configuring GTID replication on the primary but forgetting to enable it on the replica.

Restoring GTID backup into non-GTID server

Logical dumps that include GTID statements break when imported into a server with GTID_MODE=OFF.

Configuration drift after restart

Disabling GTID in my.cnf or using SET PERSIST without syncing files can flip GTID_MODE to OFF after maintenance.

Related Errors

Error 1782 ER_GTID_MODE_OFF

Occurs when attempting to enable GTID without prerequisites.

Error 1236 ER_BINLOG_READ_ERROR

Replica cannot read binary log due to missing files or permissions.

Error 3100 ER_SLAVE_CHANNEL_DOES_NOT_EXIST

Issued when commands reference a non-existent replication channel.

FAQs

Can I skip the offending GTID event?

You can use SET GLOBAL sql_slave_skip_counter=1, but this risks data divergence. Prefer enabling GTID or rebuilding the replica.

Is downtime required to enable GTID_MODE?

You must stop the SQL thread, but client reads can continue if you promote another replica temporarily.

Does enabling GTID impact performance?

GTID adds minimal overhead. For most workloads, performance difference is negligible compared with the administrative benefits.

How does Galaxy help?

Galaxy highlights replication errors in real time and offers AI-generated GTID enablement scripts, reducing manual troubleshooting.

Start Querying with the Modern SQL Editor Today!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

Check out some other errors

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie Logo
Bauhealth Logo
Truvideo Logo