Querying the Replication Mode
Query the replication mode (traditional or GTID) of MySQL primary-secondary replication. There is no performance difference between the two replication modes, and the GTID mode is recommended. The replication mode of the primary database must be the same as that of secondary databases.
- Log in to the primary database.
1/usr/local/mysql/bin/mysql -uroot -p123456 -S /data/mysql/run/mysql.sock
- Query the replication mode of the primary database.
- Query the value of gtid_mode.
If the value is ON, the GTID mode is used. Otherwise, the traditional mode is used.
1show variables like '%gtid_mode%';
- Query threads.
If the value of Command in the I/O thread is Binlog Dump GTID, GTID-based replication is used. Otherwise, traditional replication is used.
1show processlist;

- Query the value of gtid_mode.
- Log in to a secondary database.
1/usr/local/mysql/bin/mysql -uroot -p123456 -S /data/mysql/run/mysql.sock
- Query the replication mode of the secondary database.
- Query the value of gtid_mode.
If the value is ON, the GTID mode is used. Otherwise, the traditional mode is used.
1show variables like '%gtid_mode%';
- Query the status of the secondary database.
1show slave status\G;
If Executed_Gtid_Set in the command output has the same value as that of the same parameter in the command output of show master status; on the primary database, GTID-based replication is used. Otherwise, traditional replication is used.
- Query the value of gtid_mode.
Parent topic: Querying Primary-Secondary Replication