MySQL Replication encountered error 1236 fix method

Source: Internet
Author: User

MySQL Replication encountered error 1236 is a little trouble ~ usually binlog problems caused by the ~ (Master or Slave binlog bad can cause this error)

Usually encountered this situation, are Slave binlog bad, on the Slave DB of the data to solve, but this encounter is Master's Binlog bad, a little bitter ~

The error message is as follows:

last_io_errno:1236

Last_io_error:got fatal Error 1236 from master then reading data from binary Log:1client requested master to start repli Cation from impossible position2 the "the" the "the", "1mysql-bin.0035831 at 45997491," the last event read from 1./mysql-bin.003 5831 at 4, the last byte read from 1./mysql-bin.0035831 at 4.1

MySQL Replication encounters Got fatal error 1236 from master repair

Mysql> Show SLAVE STATUSG

The error message is as follows: (already removed without need)

master_log_file:mysql-bin.003583

read_master_log_pos:45997491

relay_log_file:mysqld-relay-bin.006789

relay_log_pos:103569723

relay_master_log_file:mysql-bin.003361

Slave_io_running:no

Slave_sql_running:yes

last_errno:0

skip_counter:0

last_io_errno:1236 Last_io_error:got fatal Error 1236 from master when reading data from binary Log:1client requested M Aster to start replication from impossible Position2 the "the" the "the" the "the" the "at 1mysql-bin.0035831," The last event read F Rom 1./mysql-bin.0035831 at 4, the last byte-read from 1./mysql-bin.0035831 at 4.1

Registered: Debian/ubuntu Linux preset MySQL data path:/var/lib/mysql, so the following binlog can be found on this path.

Slave Binlog The Broken Solution

Commonly common is Slave binlog is broken, so will go to Slave to find mysql-bin.003583 file first.

Then the mysql-bin.003583 data with Mysqlbinlog dump out, point to the next position can.

slave:ls/var/lib/mysql/mysql-bin.003583 # not found.

Slave did not exist in the file, only to find that the bad is Master.

Master Binlog The Broken Solution

Master: # mysqlbinlog/var/lib/mysql/mysql-bin.003583 > ~/3583

Error:error in Log_event::read_log_event (): 1read Error1, data_len:27, event_type:16

The most bitter condition is that Master's binlog is broken, so all the Slave are dead. Xd

There are several ways to consider this:

All Slave (most insured, no data lost)

First let Replication can be started, and then rewind/sync must be synchronized data. (Cache ...) You don't have to ignore him.

The following is the second approach:

Mysql> STOP SLAVE2

mysql> change MASTER to Master_log_file = 1mysql-bin.0035841, Master_log_pos = 02 # First point to the next Binlog file, pos means 0 or 4, all the same Think.

Mysql> START SLAVE2

Mysql> show SLAVE STATUS G should be restored.

Then make a pt-table-sync of the important Table with a complement. (Apt-get install Percona-toolkit)

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.