MySQL 5.6的复制中断,发生下面错误

2018-10-1812:20:0215374[ERROR]SlaveI/O:FoundaGtid_log_eventorPrevious_gtids_log_eventwhen@@GLOBAL.GTID_MODE=OFF.Error_code:17842018-10-1812:20:0215374[ERROR]SlaveI/O:Relaylogwritefailure:couldnotqueueeventfrommaster,Error_code:15952018-10-1812:20:0215374[Note]SlaveI/Othreadexiting,readuptolog'mysql-bin.000012',position1232018-10-1813:57:4115374[Note]Errorreadingrelaylogevent:slaveSQLthreadwaskilled2018-10-1813:57:4415374[Warning]StoringMySQLusernameorpasswordinformationinthemasterinforepositoryisnotsecureandisthereforenotrecommended.PleaseconsiderusingtheUSERandPASSWORDconnectionoptionsforSTARTSLAVE;seethe'STARTSLAVESyntax'intheMySQLManualformoreinformation.2018-10-1813:57:4415374[Warning]SlaveSQL:Ifacrashhappensthisconfigurationdoesnotguaranteethattherelayloginfowillbeconsistent,Error_code:02018-10-1813:57:4415374[Note]SlaveSQLthreadinitialized,startingreplicationinlog'mysql-bin.000012'atposition123,relaylog'./mysqld3319-relay-bin.000004'position:2862018-10-1813:57:4415374[Note]SlaveI/Othread:connectedtomaster'backuper@10.156.15.1:3306',replicationstartedinlog'mysql-bin.000012'atposition1232018-10-1813:57:4515374[ERROR]SlaveI/O:FoundaGtid_log_eventorPrevious_gtids_log_eventwhen@@GLOBAL.GTID_MODE=OFF.Error_code:17842018-10-1813:57:4515374[ERROR]SlaveI/O:Relaylogwritefailure:couldnotqueueeventfrommaster,Error_code:1595


报错原因:

从MySQL 5.7向较低版本的MySQL 5.6搭建复制时,会触发这个错误。

#mysqld-VmysqldVer5.6.20forLinuxonx86_64(MySQLCommunityServer(GPL))


解决方法:

使用高版本的MySQL 5.6或5.7创建复制主机。

[root@db-backup-all~]#/opt/mysql_56_40/bin/mysqld-V/opt/mysql_56_40/bin/mysqldVer5.6.40forlinux-glibc2.12onx86_64(MySQLCommunityServer(GPL))