MySQL master-slave failure error got fatal error 1236 workaround

Source: Internet
Author: User

Due to the MySQL master server external restart, resulting in slave maysql server error, errors are as follows:
View error from server:
mysql> show Slave status\g;
master_log_file:mysql-bin.000288
read_master_log_pos:627806304
relay_log_file:mysql-relay-bin.000990
relay_log_pos:627806457
relay_master_log_file:mysql-bin.000288
Slave_io_running:no
Slave_sql_running:yes
exec_master_log_pos:627806304
relay_log_space:627806663
......
Last_io_error:got fatal Error 1236 from master when reading data from binary log:
' Client requested Master to start replication from impossible position '
mysql error log:
Tail/data/mysql/mysql-error.log#绿色标示为 Database storage path
111010 17:35:49 [ERROR] Error reading packet from Server:client requested master
To start replication from impossible position (server_errno=1236)
111010 17:35:49 [ERROR] Slave I/o: Got fatal ERROR 1236 from master when reading data
From binary log: ' Client requested master-to-start replication from impossible
Position ', error_code:1236
111010 17:35:49 [Note] Slave I/O thread exiting, read up to log ' mysql-bin.000288 ',
Position 627806304

Export the relay_master_log_file:mysql-bin.000288 log

[Email protected] ~]# mysqlbinlog/data/mysql/mysql-bin.000288 > Test.txt
Less text.txt
look at the last part .
# at 627625495
#111010 16:35:46 Server ID 1 end_log_pos 627625631 Query thread_id=45613333
exec_time=32758 error_code=0
SET timestamp=1318289746/*!*/;
Delete from freeshipping_bef_update where part= ' ar-4006wlm ' and code= '
/*!*/;
# at 627625631
#111010 16:35:46 Server ID 1 end_log_pos 627625751 Query thread_id=45613333
exec_time=32758 error_code=0
SET timestamp=1318289746/*!*/;
Delete from shippingfee_special where part= ' AR-4006WLM '
/*!*/;
DELIMITER;
# End of log file
ROLLBACK/* Added by Mysqlbinlog */;
/*!50003 SET [email protected]_completion_type*/;
Find the closest error tag627655136One of the position is627625631.
Then go back to the slave machine change master and point postion to this position.
mysql> stop Slave;
Query OK, 0 rows Affected (0.00 sec)
mysql> Change Master to master_log_file= ' mysql-bin.000288 ', master_log_pos=627625631;
Query OK, 0 rows affected (0.06 sec)
mysql> start slave;
Query OK, 0 rows Affected (0.00 sec)
Check Again
Mysql> show Slave status\g;
1. Row ***************************
Slave_io_state:queueing Master event to the relay log
master_host:192.168.21.105
Master_user:rep
master_port:3306
Connect_retry:10
master_log_file:mysql-bin.000289
read_master_log_pos:25433767
relay_log_file:mysql-relay-bin.000003
relay_log_pos:630
relay_master_log_file:mysql-bin.000289
Slave_io_running:yes
Slave_sql_running:yes
The master-slave synchronization is normal and the same method is used to repair other slave machines.

This article is from the "Boyhack" blog, make sure to keep this source http://461205160.blog.51cto.com/274918/1737721

MySQL master-slave failure error got fatal error 1236 workaround

Related Article

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.