How to Fix MySQL Error 3112 (ER_CANT_USE_AUTO_POSITION_WITH_GTID_MODE_OFF)
You get mysql error 3112 when a replica tries to use automatic positioning while GTID mode is off. You fix it by turning on GTID mode or switching the replica back to file positioning. This failure stops data from syncing between your primary database and its replica nodes. The database engine tracks this issue under the symbol ER_CANT_USE_AUTO_POSITION_WITH_GTID_MODE_OFF and SQLSTATE HY000. When this fault happens, the receiver thread refuses to start. Your read nodes soon fall behind the main
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
You get mysql error 3112 when a replica tries to use automatic positioning while GTID mode is off. You fix it by turning on GTID mode or switching the replica back to file positioning.
This failure stops data from syncing between your primary database and its replica nodes. The database engine tracks this issue under the symbol ER_CANT_USE_AUTO_POSITION_WITH_GTID_MODE_OFF and SQLSTATE HY000. When this fault happens, the receiver thread refuses to start. Your read nodes soon fall behind the main server.
What causes mysql error 3112 in database clusters
MySQL uses two main ways to track changes between a source server and a replica. The older way uses binary log file names and exact byte positions. The newer way uses global transaction identifiers, also known as GTIDs. Automatic positioning is a feature that relies on these global IDs to sync data.
Mysql error 3112 happens when your settings do not match across these two methods. The replica channel is set up to use automatic positioning. Still, the server itself has its global GTID mode set to off. Because the server does not generate or track global IDs, the receiver thread cannot find its place.
This mismatch often shows up during a migration to GTID replication. An operator might enable automatic positioning on the replica before turning on GTID mode globally. It also happens when a server restarts without saving the GTID setting in its startup file. When the node comes back online, the mode defaults to off while the channel keeps its auto position rule.
How to diagnose and fix the failure in production
First, you need to check the current state of your replica server. Log in to the database with a read role that can view replication status. Check the global variables to see the current GTID mode on both the source and the replica. Next, inspect the replica status output to see if automatic positioning is active for that channel.
Once you confirm the mismatch, you must pick one of two paths to fix it. If your team wants to use GTIDs, you must turn on GTID mode step by step. MySQL allows you to change this mode online without taking the database down. You move the global mode from off to permissive, and then to on, across all nodes.
MySQL Access Governance + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Before you enable full GTID mode, make sure your server enforces GTID consistency. Every server in the cluster must follow the same rules so transactions stay safe. After both the source and replica have GTID mode turned on, you can start the replica thread again.
If your team does not want to use GTIDs, take the second path instead. Stop the replica thread and change the replication source rules to turn off automatic positioning. You will need to give the exact binary log file name and position from the source server. After you set the file position, start the replica thread and check that the error is gone.
Preventing replication state mismatches during maintenance
Most replication failures happen when admins run ad-hoc changes on live database nodes. If an engineer updates a runtime setting in memory, that change vanishes after the next reboot. Always write your GTID rules into the main server settings file at the same time.
You should also limit who can run replication commands on production databases. Give engineers read access to check status logs without handing out full admin keys. When a change is needed, review the steps carefully so source and replica settings stay in sync. Also, mask sensitive data like emails and phone numbers by rewriting matched fields in query results during checks.
Check MySQL queries and results on the wire
MySQL grants control who logs in. They do not check single queries or mask sensitive columns once a session starts. With hoop.dev, you run an open-source proxy, a sidecar for your MySQL, inline in the MySQL wire protocol. On every query an AI agent or human runs against production MySQL, RDS, or Aurora, hoop.dev decides to pass, mask, block, or hold it for review.
Multi-statement batches and prepared queries are split and checked one by one by hoop.dev guardrails, which refuse banned queries with a native MySQL error or hold risky ones for approval. On the response path, hoop.dev data masking rewrites string values in returned rows in memory, and every decision is logged. See the MIT-licensed project on GitHub.
Frequently asked questions
What does ER_CANT_USE_AUTO_POSITION_WITH_GTID_MODE_OFF mean?
This error symbol means the replication receiver thread cannot start in auto position mode. It fails because the server currently has its global GTID mode set to off.
Can I fix mysql error 3112 without restarting the database?
Yes, you can fix this error without a full server restart. You can either turn off auto positioning on the channel or enable GTID mode step by step online.
Why did mysql error 3112 appear right after a server reboot?
Someone likely turned on GTID mode in memory without saving it to the settings file. When the server rebooted, GTID mode went back to off while the channel kept auto positioning.
Related guides
In this post