How to Fix MySQL Error 3990 (ER_RPL_ASYNC_RECONNECT_GTID_MODE_OFF)
You get mysql error 3990 when you try to turn on async replication failover while GTID mode is off. To fix this issue, you must turn on global transaction IDs and auto position on your replica. MySQL uses global transaction IDs to track every change across your servers. Without this tracking, a replica cannot switch to a new source server on its own. The database stops your command to prevent lost data or broken replication streams. What causes mysql error 3990 in replication setups MySQL ma
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 3990 when you try to turn on async replication failover while GTID mode is off. To fix this issue, you must turn on global transaction IDs and auto position on your replica.
MySQL uses global transaction IDs to track every change across your servers. Without this tracking, a replica cannot switch to a new source server on its own. The database stops your command to prevent lost data or broken replication streams.
What causes mysql error 3990 in replication setups
MySQL maps this failure to symbol ER_RPL_ASYNC_RECONNECT_GTID_MODE_OFF and SQLSTATE HY000. The engine triggers this error when you change your replication source settings. You might ask the replica to use automatic connection failover.
Automatic failover lets a replica switch to a backup source if the primary fails. To do this safely, the replica needs to know which transactions it already ran. Traditional binary log file positions only make sense on a single server.
If a replica switches to a new source, file names and positions change. Global transaction IDs solve this problem by giving every change one cluster-wide label. If GTID mode is off, the replica has no safe way to find its place.
This error also happens if you turn on GTID mode but skip auto positioning. The replication channel must use the global ID stream to fetch missing updates. If either setting is off, MySQL blocks the failover setup right away.
How to diagnose the replication state safely
Before you change server settings, check the current state of your cluster. Log in to the replica and the source nodes with a read-only check role. Do not use a full admin account just to read status tables.
Check the global variables to see the current GTID mode on every server. Look at the replication connection status table on the replica as well. You want to see if the channel uses auto positioning right now.
Check your error logs for recent alerts about replication channels or source lists. Sometimes a startup script tries to turn on failover before the database finishes setup. Knowing the exact order of your setup scripts helps prevent repeat errors.
MySQL Access Governance + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Verify that every source server in your failover list also uses global transaction IDs. If one backup source has the feature turned off, failover will break later. Every node in the group must share the same transaction tracking rules.
How to fix the error in production
Fixing this error takes a few planned steps across your database cluster. First, make sure all source and replica servers enforce GTID consistency. This rule checks that all queries work safely with transaction IDs.
Next, step through the GTID mode states until the mode is fully on. MySQL lets you do this online without taking the database down. Move from off to permissive modes, and then set the mode to on.
Once GTID mode is on across all servers, update the replica channel. Stop the replication threads on the replica during a quiet traffic window. Enable the auto position option on the replication channel first.
After auto positioning is active, turn on the async connection failover setting again. Start the replication threads and check the status tables for any new warnings. The replica can now switch between healthy source servers if a link drops.
Keep your database privileges tight while you run these fix steps. Grant replication admin rights only for the time needed to update the channel. Avoid leaving broad superuser permissions open on developer accounts after the fix.
Add wire guardrails and masking beside MySQL
Database grants and TLS setup decide who can reach MySQL. Even so, an open session can run broad updates or read raw personal data from allowed tables. In practice, hoop.dev sits inline in the wire protocol beside the database as a sidecar for your MySQL. On every production query an agent or engineer sends, hoop.dev decides to pass, mask, block, or escalate it for human review.
With hoop.dev MySQL support, guardrails refuse bad queries before they run or hold risky calls for approval, while data masking rewrites matched sensitive values in result rows in memory. Furthermore, hoop.dev holds SOC 2 Type II and generates evidence for GDPR, HIPAA, and PCI DSS programs. Read the docs and source on GitHub.
Frequently asked questions
Can I turn on GTID mode without restarting MySQL?
Yes, modern MySQL versions let you turn on GTID mode while the server runs. You must step through each permissive mode in order on all nodes.
Why does async failover require auto positioning?
Auto positioning tells the replica to match transactions by their global ID instead of log file coordinates. This allows the replica to resume work on any valid source server.
Does mysql error 3990 stop active replication?
No, this error only rejects the command that changes your replication source settings. Your existing replication stream keeps running with its old settings until you stop it.
Related guides
In this post