报错信息如下:

Got fatal error 1236 from master when reading data from binary log: '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.'

解决方法:

查看主库 master gtid_purged

mysql> show global variables like '%gtid%';

从库执行

mysql> stop slave;

mysql> reset slave;

mysql> reset master;

mysql> set @@global.gtid_purged='主库的GITD值';  # 这样会丢失部分数据,知晓

mysql> change master to master_host='MASTER_IP',master_port=PORT,master_user='USERNAME',master_password='PASSWORD',master_auto_position=1;

或 

mysql> CHANGE MASTER TO MASTER_AUTO_POSITION=1;

mysql> start slave;

mysql> show slave status \G

注意:设置gtid_purged值时,gtid_executed值必须为空否则报错,该值清空的方法就是reset  master,reset slave命令。

相关文章:

  • 2021-07-18
  • 2021-08-02
  • 2021-12-06
  • 2021-05-27
  • 2021-12-10
  • 2021-05-26
  • 2021-12-08
猜你喜欢
  • 2022-02-03
  • 2022-12-23
  • 2021-04-28
  • 2022-01-17
  • 2021-06-06
  • 2021-09-26
  • 2022-12-23
相关资源
相似解决方案