Error
Error Code: 1779

MySQL Error 1779: GTID_MODE Requires Consistency

📦 MySQL
📋

Description

This error indicates a critical configuration mismatch where MySQL's Global Transaction Identifiers (GTID) are enabled (`GTID_MODE = ON`), but the necessary `ENFORCE_GTID_CONSISTENCY` variable is not also enabled. MySQL requires `ENFORCE_GTID_CONSISTENCY = ON` to ensure that all transactions are safe for GTID-based replication, preventing data inconsistencies. This typically occurs during server startup or when attempting to modify GTID-related system variables.
💬

Error Message

GTID_MODE = ON requires ENFORCE_GTID_CONSISTENCY = ON.
🔍

Known Causes

3 known causes
⚠️
Incorrect Server Configuration
The MySQL server's configuration file (my.cnf or my.ini) has `GTID_MODE = ON` set, but `ENFORCE_GTID_CONSISTENCY` is explicitly `OFF` or not defined, leading to a conflict.
⚠️
Dynamic Variable Change Attempt
An attempt was made to set `GTID_MODE = ON` using `SET GLOBAL` at runtime without also ensuring that `ENFORCE_GTID_CONSISTENCY` was already `ON` or setting it concurrently.
⚠️
Replication Setup Mismatch
During the setup or modification of a replication topology, GTID-related variables were not correctly synchronized or enabled in the proper sequence across master and replica servers.
🛠️

Solutions

3 solutions available

1. Enable GTID Consistency easy

The recommended approach to resolve this error by enabling GTID consistency alongside GTID mode.

1
Edit your MySQL configuration file. This is typically `my.cnf` or `my.ini`.
2
Locate the `[mysqld]` section and add or modify the following lines:
[mysqld]
GTID_MODE = ON
ENFORCE_GTID_CONSISTENCY = ON
3
Save the configuration file and restart the MySQL server.

2. Disable GTID Mode easy

A quick fix if GTID is not strictly required for your setup.

1
Edit your MySQL configuration file. This is typically `my.cnf` or `my.ini`.
2
Locate the `[mysqld]` section and change or remove the `GTID_MODE` setting:
[mysqld]
# GTID_MODE = ON  <-- Comment out or remove this line
# OR
# GTID_MODE = OFF
3
Save the configuration file and restart the MySQL server.

3. Update Configuration Dynamically (Requires Restart) medium

Modify the MySQL configuration directly on a running server, but a restart is still needed.

1
Connect to your MySQL server as a user with sufficient privileges (e.g., root).
2
Execute the following SQL commands to set the parameters. Note that `ENFORCE_GTID_CONSISTENCY` cannot be set dynamically in all MySQL versions. This method is primarily for demonstrating the required settings before a restart.
SET GLOBAL GTID_MODE = 'ON';
-- SET GLOBAL ENFORCE_GTID_CONSISTENCY = 'ON'; -- This command may not work dynamically in all versions.
3
Edit your MySQL configuration file (`my.cnf` or `my.ini`) to permanently apply these settings. Add or ensure these lines are present in the `[mysqld]` section:
[mysqld]
GTID_MODE = ON
ENFORCE_GTID_CONSISTENCY = ON
4
Save the configuration file and restart the MySQL server for the changes to take full effect.
🔗

Related Errors

5 related errors