MySql 错误 1872

MySql版本:5.7

MySQL主从复制,启动slave时,出现下面报错:
mysql> start slave;
ERROR 1872 (HY000): Slave failed to initialize relay log info structure from the repository

原因:一般情况下是主从同步,搬家/移动之后造成的

解决:

reset slave;
change master to master_host='xxx.xxx.xxx.xxx',master_port=3306,master_user='用户名',master_password='密码',master_auto_position=1;
#备注master_auto_position=1这是mysql5.7新的同步方式.低于5.7版本请自行填充pos
start slave;

标签