MySQL1236 troubleshooting _ MySQL

Source: Internet
Author: User
MySQL1236 error solution bitsCN.com

MySQL 1236 error solution

The slave server reports an error due to the abnormal restart of the master server. the error is as follows:

Show slave status error:

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

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

[Root @ db1 ~] # Mysqlbinlog/data/mysql/binlog/mysql-bin.000288> mysql-bin.000288. SQL

Less mysql-bin.000288. SQL

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 COMPLETION_TYPE = @ OLD_COMPLETION_TYPE */;

Locate a position closest to error 627655136 which is 627625631.

Return to the server load balancer instance and change master to point postion to this location.

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)

View 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 other slave machines are repaired in the same way.

BitsCN.com

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.