MASTER_AUTO_POSITION but the master has purged binary logs containing GTIDs that the slave requires.

搭建GTID复制,
报错:
'The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires.

解决方案:
主库:

mysql> show global variables like 'gtid_purged';

记下主库的gtid_purged的值
MASTER_AUTO_POSITION but the master has purged binary logs containing GTIDs that the slave requires._第1张图片

从库:

从库设置global.gtid_purged为主库的gtid_purged的值

mysql> stop slave;
Query OK, 0 rows affected (0.04 sec)

mysql> reset master;
Query OK, 0 rows affected (0.01 sec)

mysql> set @@global.gtid_purged='a70842d9-9311-11ea-9056-000c295cda02:1';
Query OK, 0 rows affected (0.45 sec)

mysql> start slave;
Query OK, 0 rows affected (0.11 sec)

解决~
MASTER_AUTO_POSITION but the master has purged binary logs containing GTIDs that the slave requires._第2张图片

你可能感兴趣的:(MySQL)