Common SQL Errors

MySQL Error 1779: ER_GTID_MODE_ON_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON - How to Fix and Prevent

Galaxy Team
August 7, 2025

<p>MySQL throws error 1779 when GTID_MODE is set to ON while ENFORCE_GTID_CONSISTENCY remains OFF.</p>

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 1779?

<p>MySQL Error 1779: ER_GTID_MODE_ON_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON means you enabled GTID transactions without also enabling enforce_gtid_consistency. Turn on ENFORCE_GTID_CONSISTENCY or switch GTID_MODE back to OFF to fix the issue.</p>

Error Highlights

Typical Error Message

GTID_MODE = ON requires ENFORCE_GTID_CONSISTENCY = ON.

Error Type

Configuration Error

Language

MySQL

Symbol

ER_GTID_MODE_ON_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON

Error Code

1779

SQL State

HY000

Explanation

Table of Contents

What is MySQL Error 1779 ER_GTID_MODE_ON_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON?

Error 1779 appears with the message "GTID_MODE = ON requires ENFORCE_GTID_CONSISTENCY = ON" whenever you enable global transaction identifiers (GTIDs) but leave enforce_gtid_consistency disabled. The server refuses the configuration because inconsistent statements break GTID guarantees.

The error was introduced in MySQL 5.7.6 and affects all later versions, including 8.x. It can surface during server startup, runtime configuration changes, or replication setup scripts.

Why does MySQL link GTID_MODE and ENFORCE_GTID_CONSISTENCY?

GTID replication relies on every transaction being safely logged and re-playable on replicas. Non-deterministic or unsafe statements can corrupt replica state. ENFORCE_GTID_CONSISTENCY blocks those statements, so MySQL mandates it before you can switch GTID_MODE to ON.

Without the consistency flag, statements like CREATE TABLE ... SELECT or UPDATE with LIMIT are allowed, leading to divergent data on replicas. Error 1779 prevents that risk.

When does this error commonly occur?

Administrators often hit the error while migrating an existing server to GTID replication. It also appears in containerized images where only GTID_MODE is toggled via environment variables. Runtime changes with SET @@GLOBAL.gtid_mode = ON fail if ENFORCE_GTID_CONSISTENCY is OFF.

The error may be buried in startup logs, causing the server to remain in OFF_PERMISSIVE mode rather than the desired ON state.

Impact of leaving the error unresolved

Failure to enable GTID replication means you lose automatic failover and simpler replica promotion. Mixed GTID and non-GTID servers complicate recovery procedures, lengthen downtime, and increase data-loss risk.

Common Causes

Cause 1 - Incomplete my.cnf changes

Only gtid_mode=ON was added to the configuration file, leaving enforce_gtid_consistency unspecified or OFF.

Cause 2 - Runtime SET statements

An administrator issued SET GLOBAL gtid_mode = ON before enabling enforce_gtid_consistency during an online migration.

Cause 3 - Automation scripts

DevOps templates or Docker images toggle GTID_MODE with environment variables but omit the corresponding consistency flag.

Cause 4 - Misordered statements

The consistency flag was enabled, then disabled later in the same script before GTID_MODE was activated.

Related Errors

MySQL Error 1780: ER_GTID_MODE_REQUIRES_BINLOG

Occurs when GTID_MODE is ON but binary logging is disabled.

MySQL Error 1776: ER_GTID_UNSAFE_CREATE_SELECT

Triggers when CREATE TABLE ... SELECT is executed without GTID consistency enforced.

MySQL Error 1781: ER_CANT_SET_GTID_MODE

Happens if you try to change GTID_MODE while there are ongoing transactions.

FAQs

Is it safe to enable enforce_gtid_consistency in production?

Yes. The change only blocks unsafe statements; regular DML continues unaffected.

Can I disable enforce_gtid_consistency after turning on GTID_MODE?

No. MySQL will reject the change while GTID_MODE is ON to protect replication integrity.

Does error 1779 affect MySQL 5.6?

No. The variable pair was introduced in 5.7.6, so 5.6 servers never raise this error.

How does Galaxy help avoid this error?

Galaxy surfaces server variables in its sidebar and flags conflicting settings, guiding you to enable both options before running migration scripts.

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