PHP群:95885625 Hbuilder+MUI群:81989597 站长QQ:634381967
    您现在的位置: 首页 > 数据库 > MySQL教程 > 正文

    mysql中Relay log read failure master slave的解决方法

    作者:admin来源:网络浏览:时间:2020-09-30 00:07:50我要评论
    导读:show slave status G 提示如下错误Relay log read failure: Could not parse relay log event entry. The possible reaso...

    show slave status G  提示如下错误
    Relay log read failure: Could not parse relay log event entry. The possible reasons are:
    the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log),
    the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log),
    a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's
    binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave.

    原因分析:
    在传输master log-bin时,因网络原因或slave机压力问题,造成log-relay文件格式错误

    找到如下的解决方法,分享给大家。
    方法一:
    找到relay-log.info,第一行记录了当前正在执行的log-relay文件名,找到该文件的下一个文件。
    使用mysqlbinlog查看该文件,在#98这行有Rotate to log-bin.000004 pos: 4等信息,这是目前slave停止的位置。
    在slave上重新指定同步位置,重新执行:
     

    change master to
    master_host='1.1.1.1',
    master_user='repl',
    master_password='111111',
    master_port=3306,
    master_log_file='log-bin.000004',
    master_log_pos=4;
    slave start;
    show slave statusG;

    方法二:
    stop slave之后,重新reset slave;
    再次查看,此时数据已经开始同步了。

    希望以上的方法,可以帮助大家解决问题。

    转载请注明(B5教程网)原文链接:https://b5.mxunkeji.com/content-35-3908-1.html
    相关热词搜索: