Error
Error Code: 1783

MySQL Error 1783: GTID_NEXT_LIST Mode Conflict

📦 MySQL
📋

Description

This error indicates an attempt to specify a Global Transaction Identifier (GTID) using `@@SESSION.GTID_NEXT_LIST` while the MySQL server's global GTID mode (`@@GLOBAL.GTID_MODE`) is disabled. It signifies a fundamental mismatch between the desired transaction identification and the server's current GTID configuration.
💬

Error Message

@@SESSION.GTID_NEXT_LIST cannot be set to a non-NULL value when @@GLOBAL.GTID_MODE = OFF.
🔍

Known Causes

3 known causes
⚠️
Direct GTID_NEXT_LIST Assignment
A `SET @@SESSION.GTID_NEXT_LIST = ...` statement was executed directly or via a script when `@@GLOBAL.GTID_MODE` was `OFF`.
⚠️
Replication Setup Mismatch
A replication client, master, or replica attempted GTID-based operations, but the relevant MySQL server has `@@GLOBAL.GTID_MODE` disabled.
⚠️
Application GTID Expectation
An application or ORM configured to use GTIDs connected to a MySQL server where `@@GLOBAL.GTID_MODE` was `OFF`, leading to an attempt to set `GTID_NEXT_LIST`.
🛠️

Solutions

3 solutions available

1. Enable GTID Mode Globally medium

The most robust solution is to enable GTID_MODE globally, which is the intended use case for GTID_NEXT_LIST.

1
Connect to your MySQL server as a user with sufficient privileges (e.g., root).
2
Check the current GTID_MODE. If it's OFF, you'll need to change it.
SHOW GLOBAL VARIABLES LIKE 'GTID_MODE';
3
To enable GTID_MODE, you need to modify the MySQL configuration file. Locate your `my.cnf` or `my.ini` file. The location varies by operating system and installation method (e.g., `/etc/mysql/my.cnf`, `/etc/my.cnf`, `C:\ProgramData\MySQL\MySQL Server X.Y\my.ini`).
4
Add or modify the `gtid_mode` setting within the `[mysqld]` section of your configuration file to `ON` or `ENFORCE`.
[mysqld]
gtid_mode = ON
5
Restart the MySQL server for the changes to take effect. The command to restart depends on your operating system and init system.
# For systems using systemd (e.g., Ubuntu 15.04+, CentOS 7+, Debian 8+)
sudo systemctl restart mysql

# For systems using SysVinit (e.g., older Ubuntu/Debian, CentOS 6)
sudo service mysql restart
6
After restarting, verify that GTID_MODE is enabled.
SHOW GLOBAL VARIABLES LIKE 'GTID_MODE';
7
Now you can set `SESSION.GTID_NEXT_LIST` without encountering the error.
SET SESSION GTID_NEXT_LIST = 'your_gtid_set';

2. Disable GTID Mode Globally easy

If GTID is not required, disabling it globally is a quick way to resolve the conflict.

1
Connect to your MySQL server as a user with sufficient privileges (e.g., root).
2
Check the current GTID_MODE. If it's not OFF, you'll need to change it.
SHOW GLOBAL VARIABLES LIKE 'GTID_MODE';
3
To disable GTID_MODE, you need to modify the MySQL configuration file. Locate your `my.cnf` or `my.ini` file.
4
Add or modify the `gtid_mode` setting within the `[mysqld]` section of your configuration file to `OFF`.
[mysqld]
gtid_mode = OFF
5
Restart the MySQL server for the changes to take effect.
# For systems using systemd (e.g., Ubuntu 15.04+, CentOS 7+, Debian 8+)
sudo systemctl restart mysql

# For systems using SysVinit (e.g., older Ubuntu/Debian, CentOS 6)
sudo service mysql restart
6
After restarting, verify that GTID_MODE is OFF.
SHOW GLOBAL VARIABLES LIKE 'GTID_MODE';
7
The error should no longer occur when attempting to set `SESSION.GTID_NEXT_LIST` (though it's generally not recommended to set this when GTID is OFF).

3. Avoid Setting SESSION.GTID_NEXT_LIST When GTID_MODE is OFF easy

If you don't intend to use GTIDs, simply remove any commands that attempt to set SESSION.GTID_NEXT_LIST.

1
Identify the script, application code, or manual command that is attempting to set `SESSION.GTID_NEXT_LIST`.
2
Review the context in which `SESSION.GTID_NEXT_LIST` is being set. If your application or replication setup does not rely on GTIDs, remove or comment out the line that executes this command.
SET SESSION GTID_NEXT_LIST = 'your_gtid_set';
3
Ensure that your MySQL server's `GTID_MODE` is indeed `OFF` if you are not using GTIDs. This is the default behavior for older MySQL versions.
SHOW GLOBAL VARIABLES LIKE 'GTID_MODE';
🔗

Related Errors

5 related errors