13
2025
03
21:39:50

MySQL主从同步故障 Slave failed to initialize relay log info structure from the repository

之前做的是数据库主主同步,最近发现数据库A可以从数据库B同步,但数据库B不能从数据库A同步,通过在数据库B执行show slave status可以发现Slave failed to initialize relay log info structure from the repository错误,且Slave_IO_RunningSlave_SQL_Running这两项都是NO。通过重启两台数据库服务,均无法解决。
通过网络搜索,解决办法如下:
在数据库B执行:

stop slave;
reset slave;
change master to master_host='数据库A地址',master_port=3306,master_user='同步账号',master_password='同步账号的密码',master_auto_position =  1;
start slave;

执行后,发现Slave_IO_RunningSlave_SQL_Running这两项都是YES了,但其中的Seconds_Behind_Master是非0值,说明此时数据库B的数据落后于数据库A,表示这两台数据库之间有延时,数字越大,则说明延迟越大。耐心等待该值变为0后,则说明已完成同步。




推荐本站淘宝优惠价购买喜欢的宝贝:

image.png

本文链接:https://sg.hqyman.cn/post/9587.html 非本站原创文章欢迎转载,原创文章需保留本站地址!

分享到:
打赏





休息一下~~


« 上一篇 下一篇 »

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

请先 登录 再评论,若不是会员请先 注册

您的IP地址是: