How to Fix MySQL Error 4068 (ER_CHANGE_REP_SOURCE_CANT_DISABLE_GTID_ONLY_WITHOUT_POSITIONS)
You trigger mysql error 4068 when you turn off global transaction mode without log positions. You can fix this error by giving the exact binary log file name and position. Database admins see this alert when they update replication channels on a live server. MySQL stops the change to protect your replica from losing its place in the stream. If the database allowed this change without coordinates, replication would stop or skip key data. Understanding how the engine tracks transactions helps you
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 trigger mysql error 4068 when you turn off global transaction mode without log positions. You can fix this error by giving the exact binary log file name and position.
Database admins see this alert when they update replication channels on a live server. MySQL stops the change to protect your replica from losing its place in the stream. If the database allowed this change without coordinates, replication would stop or skip key data. Understanding how the engine tracks transactions helps you fix the problem without risking data loss.
What causes mysql error 4068 in replication channels
The database engine returns code 4068 under the general SQL state HY000 during channel updates. The server symbol for this event is ER_CHANGE_REP_SOURCE_CANT_DISABLE_GTID_ONLY_WITHOUT_POSITIONS in the error log. This message states that disabling GTID_ONLY and auto position requires a source log file and position.
When a replica runs in transaction ID only mode, it skips file coordinate checks. The server does not write or update binary log file names and byte offsets in memory. Instead, it relies on global transaction identifiers to find the right point in the stream.
A problem starts when an admin turns off both transaction mode and auto position together. At that moment, the replica needs file coordinates to know where to read next. Because the channel skipped tracking those coordinates earlier, the stored file positions are now invalid. The database rejects your command right away so the replica does not read bad data.
How to diagnose and fix the failure in production
Before you run any fix, check the current status of the broken replication channel. Look at the replica status output to see which modes are active right now. Confirm that the replication threads are stopped before you try to change any channel settings.
You have two safe ways to resolve this error depending on your replication goals. First, ask your team if you still want to use automatic transaction positioning. If you keep auto positioning active, you can turn off the transaction only flag alone. The replica will start tracking file positions again while using transaction IDs to sync data.
MySQL Access Governance + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Second, you might want to switch the channel back to standard binary log file positioning. To do this, you must find the exact log file name and byte offset first. Check the source server or the replica relay logs to find the last applied transaction. Match that transaction to its exact binary log file name and numerical position on the source. Then pass both the log file name and the log position in your change command.
Securing database admin tasks during replication fixes
Fixing replication errors requires high privileges on both the source and the replica servers. Giving broad admin credentials to every engineer on call increases the risk of human error. A small mistake in a replication statement can stall a cluster or expose sensitive tables.
Teams should route database maintenance tasks through a central control plane with strict access rules. You can require peer approval before anyone runs commands that alter replication channels in production. While admins inspect tables to check sync status, dynamic data masking protects private user records. Masking rewrites matched fields like emails, phone numbers, card numbers, and national IDs in results. This setup lets engineers fix broken channels fast while keeping production data safe and audited.
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
Does mysql error 4068 corrupt data on the replica server?
No, this error is a safety check that blocks an invalid change before it runs. Your existing data remains safe, and the channel keeps its previous settings until you fix it.
Can I turn off GTID_ONLY while keeping auto positioning active?
Yes, you can disable the GTID_ONLY setting by itself if auto position stays turned on. You only need to give a log file and position when disabling both settings together.
Where do I find the right binary log file and position?
Check the replica status output to find the last transaction ID that the server ran. Then inspect the binary logs on the source server to find the matching file offset.
Related guides
In this post