Common SQL Errors

MySQL Error 3112: ER_CANT_USE_AUTO_POSITION_WITH_GTID_MODE_OFF - How to Fix and Prevent

Galaxy Team
August 8, 2025

Replication fails because AUTO_POSITION requires GTID_MODE=ON but the server is running with GTID_MODE=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 3112 ER_CANT_USE_AUTO_POSITION_WITH_GTID_MODE_OFF?

ER_CANT_USE_AUTO_POSITION_WITH_GTID_MODE_OFF appears when you start replication with AUTO_POSITION=1 while gtid_mode is OFF. Switch gtid_mode to ON (or OFF_PERMISSIVE) and restart the channel to resolve the issue.

Error Highlights

Typical Error Message

ER_CANT_USE_AUTO_POSITION_WITH_GTID_MODE_OFF

Error Type

Replication Error

Language

MySQL

Symbol

AUTO_POSITION mode: this server uses @@GLOBAL.GTID_MODE = OFF. ER_CANT_USE_AUTO_POSITION_WITH_GTID_MODE_OFF was added in 5.7.6.

Error Code

3112

SQL State

HY000

Explanation

Table of Contents

What is MySQL error 3112 ER_CANT_USE_AUTO_POSITION_WITH_GTID_MODE_OFF?

Error 3112 is raised when a replica (receiver thread) is configured with AUTO_POSITION = 1, but the source server has gtid_mode set to OFF. MySQL cannot compute coordinates from global transaction identifiers if GTID support is disabled, so replication start fails.

The message only appears in MySQL 5.7.6 and later because that is when the server added strict checks for GTID consistency. Fixing it quickly is vital because the channel will remain stopped and data will diverge.

What Causes This Error?

The primary cause is a mismatch between replication settings: AUTO_POSITION requires GTID_MODE=ON or OFF_PERMISSIVE, yet the server variable gtid_mode is OFF. The receiver thread detects the conflict during START SLAVE or CHANGE MASTER.

The error can also surface after an upgrade or configuration drift where GTID_MODE was unintentionally turned off while the replica configuration still contains MASTER_AUTO_POSITION=1.

How to Fix ER_CANT_USE_AUTO_POSITION_WITH_GTID_MODE_OFF

Enable GTID on the source (and ideally on replicas) or disable auto_position on the replica. Enabling GTID preserves modern fail-over features.

Steps to enable GTID without downtime: set gtid_mode to OFF_PERMISSIVE, set enforce_gtid_consistency, restart if needed, then switch to ON, and finally restart replication.

Common Scenarios and Solutions

Scenario 1 - New replica on legacy source: either add GTID to the source or create the replica with file/position coordinates.

Scenario 2 - Accidentally changed gtid_mode after upgrade: set it back to ON and restart both source and replica threads.

Best Practices to Avoid This Error

Standardise GTID settings through configuration management, audit server variables at startup, and monitor the replica SQL thread status. Always apply CHANGE MASTER statements that match the source's GTID mode.

Related Errors and Solutions

Error 3170 ER_AUTO_POSITION_REQUIRES_GTID_MODE_ON can surface in similar conditions. Error 1776 ER_GTID_MODE_REQUIRED_ON further enforces GTID consistency. They share the same remedy - align GTID mode with replication settings.

Common Causes

GTID mode set to OFF

The server variable @@global.gtid_mode is OFF while replication expects GTIDs.

Configuration drift after upgrade

An upgrade script or manual change removed gtid_mode=ON from my.cnf, causing the mismatch.

Replica cloned from different environment

A replica cloned from a GTID-enabled source was pointed to a non-GTID master without updating MASTER_AUTO_POSITION.

Incorrect CHANGE MASTER command

The DBA executed CHANGE MASTER TO MASTER_AUTO_POSITION = 1 against a server that never had GTID enabled.

Related Errors

ER_AUTO_POSITION_REQUIRES_GTID_MODE_ON (3170)

Raised when CHANGE MASTER has MASTER_AUTO_POSITION = 1 while GTID mode is not ON.

ER_GTID_MODE_REQUIRED_ON (1776)

Occurs during online DDL when GTID_MODE is OFF and the operation needs GTID consistency.

ER_MASTER_AUTO_POSITION_FAILED (1231)

Signals that the replica failed to fetch GTID execution history from the source.

FAQs

Can I enable GTID without restarting MySQL?

Yes - switch through OFF_PERMISSIVE to ON, but you must restart replication threads after the change.

Is AUTO_POSITION mandatory for GTID replication?

No, but it simplifies failover and eliminates manual file/position management, so it is highly recommended.

Will enabling GTID affect performance?

The overhead is minimal on modern hardware. Benefits in failover and consistency outweigh the cost.

How does Galaxy help avoid this error?

Galaxy validates server variables before running CHANGE MASTER commands and highlights GTID mismatches, preventing accidental misconfiguration.

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