Error
Error Code:
1773
MySQL Error 1773: Invalid GTID Set Format
Description
This error indicates that a Global Transaction Identifier (GTID) set string provided to MySQL is not correctly formatted or encoded. It typically occurs during replication operations, GTID-based backups, or when manually manipulating GTID-related functions or variables. MySQL cannot parse the provided GTID set, preventing the intended operation.
Error Message
Malformed GTID set encoding.
Known Causes
3 known causesInvalid GTID Set Syntax
The provided GTID set string does not conform to MySQL's expected syntax for GTID sets, such as missing colons, invalid ranges, or incorrect separators.
Character Encoding Mismatch
The GTID set string was encoded using an incompatible character set, causing MySQL to misinterpret its structure and consider it malformed.
Truncated or Corrupted Data
The GTID set string was truncated or corrupted during storage or network transmission, resulting in an incomplete or unreadable format.
Solutions
3 solutions available1. Correctly Format GTID Sets easy
Ensure GTID sets are written in the standard 'uuid:interval,...' format.
1
Review the GTID set you are providing. The standard format is a comma-separated list of UUIDs, where each UUID is followed by a colon and a comma-separated list of intervals. Intervals can be single numbers or ranges (e.g., '1-10').
Example of a valid GTID set: 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:1-5,ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj:10,kkkkkkkk-llll-mmmm-nnnn-oooooooooooo:20-30'
2
If you are manually constructing a GTID set, ensure each UUID is correctly formed (e.g., 32 hexadecimal characters separated by hyphens in the standard 8-4-4-4-12 format) and that intervals are valid numbers or ranges.
3
When using commands that accept GTID sets (like `CHANGE MASTER TO` or `CHANGE REPLICATION SOURCE TO`), double-check the syntax for any typos or incorrect separators.
Incorrect: 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee;1-5'
Correct: 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:1-5'
2. Retrieve and Use Correct GTID Information medium
Obtain valid GTID information from your source and use it accurately for replication setup.
1
On your primary (source) MySQL server, query the current GTID set using `SHOW MASTER STATUS` or `SHOW REPLICA STATUS` (for newer MySQL versions).
SHOW MASTER STATUS;
-- Or for newer versions:
SHOW REPLICA STATUS;
2
Locate the `Executed_Gtid_Set` or `Executed_Gtid_Set` value in the output. This is the authoritative GTID set for your source.
Example output snippet:
Executed_Gtid_Set: aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:1-5,ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj:10
3
Use this retrieved GTID set when configuring your replica (e.g., in `CHANGE MASTER TO` or `CHANGE REPLICATION SOURCE TO` commands). Ensure you copy it precisely, without any modifications.
CHANGE MASTER TO MASTER_HOST='source_host', MASTER_USER='repl_user', MASTER_PASSWORD='repl_password', MASTER_PORT=3306, MASTER_AUTO_POSITION=1, MASTER_GTID_ONLY=1;
-- Or if you are manually specifying GTIDs (less common with AUTO_POSITION=1):
-- CHANGE MASTER TO MASTER_HOST='source_host', MASTER_USER='repl_user', MASTER_PASSWORD='repl_password', MASTER_PORT=3306, MASTER_GTID_SET='aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:1-5,ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj:10';
3. Verify MySQL Version Compatibility for GTID Sets medium
Ensure your MySQL versions support the GTID format being used and have GTID enabled.
1
Check the MySQL version on both your source and replica servers. GTID support was introduced in MySQL 5.6 and has evolved in subsequent versions.
SELECT VERSION();
2
Ensure that `gtid_mode` is set to `ON` and `enforce_gtid_consistency` is set to `ON` on both servers if you intend to use GTID-based replication.
SHOW VARIABLES LIKE 'gtid_mode';
SHOW VARIABLES LIKE 'enforce_gtid_consistency';
3
If these variables are not set correctly, you will need to modify your MySQL configuration file (`my.cnf` or `my.ini`) and restart the MySQL server. Be aware that changing `gtid_mode` might require reinitializing the data directory.
[mysqld]
gtid_mode = ON
enforce_gtid_consistency = ON
4
Consult the MySQL documentation for your specific version to understand the nuances of GTID implementation and any potential version-specific formatting requirements.