MySQL5.1 Relay Log read failure error resolution for master-slave synchronization _mysql

Source: Internet
Author: User
Tags mysql code

It is well known that the replication of MySQL5.1 is rather rotten. Each version of MySQL updates about sync every time you see a whole bunch of them. But the MySQL 5.1 performance is more outstanding. So you can't resist using MySQL 5.1. So you also have to meet a few bugs frequently. Such as:

Copy Code code as follows:

Mysql> Show Slave Status\g
1. Row ***************************
Slave_io_state:waiting for Master to send event
master_host:192.168.10.118
Master_user:repl_wu
master_port:3306
Connect_retry:30
master_log_file:mysql-bin.005121
read_master_log_pos:64337286
relay_log_file:relay-bin.003995
relay_log_pos:18446697137031827760
relay_master_log_file:mysql-bin.005121
Slave_io_running:yes
Slave_sql_running:no
replicate_do_db:
replicate_ignore_db:
Replicate_do_table:
Replicate_ignore_table:
Replicate_wild_do_table:
Replicate_wild_ignore_table:
last_errno:1594
Last_error: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 (for your 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 are want to check the master's binary log or slave ' s relay log, you'll be able to know their of names by issuing ' show s Lave STATUS ' on this slave.
skip_counter:0
Exec_master_log_pos:4
relay_log_space:64337901
Until_condition:none
Until_log_file:
until_log_pos:0
Master_ssl_allowed:no
Master_ssl_ca_file:
Master_ssl_ca_path:
Master_ssl_cert:
Master_ssl_cipher:
Master_ssl_key:
Seconds_behind_master:null
Master_ssl_verify_server_cert:no
last_io_errno:0
Last_io_error:
last_sql_errno:1594
Last_sql_error: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 (for your 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 are want to check the master's binary log or slave ' s relay log, you'll be able to know their of names by issuing ' show s Lave STATUS ' on this slave.
1 row in Set (0.00 sec)

From above you can see that the relay day value or the day value on master is a problem.

First, if the relay day value is broken, it just needs to find the sync point and then resynchronize it so that you can have a new relay day value. Trouble if the day value on Master is broken.

From an experience point of view, this is the relay day value problem. Processing method:

Need to find the sync point.

The Daily value is: master_log_file:mysql-bin.005121,relay_master_log_file:mysql-bin.005121 to Relay_master_log_file, Master_Log _file for reference.

Day value Execution Time point:

Copy Code code as follows:
Exec_master_log_pos:4

So now you can:

Copy Code code as follows:

Mysql>stop slave;

Mysql>change Master to master_log_file= ' mysql-bin.005121 ', master_log_pos=4;

Mysql>start slave;

Mysql>show slave status\g;

For confirmation.

Suggestions:

Please upgrade to MySQL-5.1.40 & Mysql-5.1.37sp1 as soon as possible in the version below using MySQL-5.1.36

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.