Mysql Master Slave Synchronization Last_IO_Errno: 1236 Error Resolution

  • 2021-09-12 02:30:57
  • OfStack

What is the cause of the Last_IO_Errno: 1236 error for Mysql master-slave synchronization, and how can we resolve it? Let's take a look at the records and solutions of this problem with this site 1.


<script>ec(2);</script>

Error code from server:


Last_IO_Errno: 1236
Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Slave can not handle replication events with the checksum that master is configured to log; the first event 'mysql-bin.000005' at 16750821, the last event read from '/usr/local/mysql/Binlog/mysql-bin.000005' at 16750821, the last byte read from '/usr/local/mysql/Binlog/mysql-bin.000005' at 120.'

I roughly analyzed the reasons for 1, and I think the most likely factors are due to the different versions of ① mysql; ② Incomplete backup. This problem does not exist with mysql with the same configuration version before. (Time problem, no specific test reason)

The main server was upgraded to the latest version of mysql (5.6. 29) due to the downtime caused by php last time, while the slave server used the version of db of 5.5. 49 when I just compiled, so I inferred that it might be caused by this problem. I didn't read the official documents, but I just guessed.

Another problem caused by different versions is:


[root@Backup tmp]# /usr/local/mysql/bin/mysql -uroot -p <./all.sql 
Enter password: 
ERROR 1064 (42000) at line 279: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STATS_PERSISTENT=0' at line 11

I lazy, directly recompile the same version of mysql, specific reasons and versions are different, not carefully studied.

slave Temporarily Skip Error Method:

MySQL


mysql>slave stop;  #stop slave
mysql>SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
mysql>slave start;  #start slave

slave Permanently Skip Errors:


vi /etc/my.cnf
[mysqld]
slave-skip-errors=1062,1053,1146 # Skip Specification error no Error of type 
#slave-skip-errors=all # Skip all errors 

Summarize

The above is all about the error resolution of Mysql master-slave synchronization Last_IO_Errno: 1236 in this article, hoping to be helpful to everyone. If you have any better treatment method, you can leave a message, and everyone will exchange and discuss it.

Interested friends can refer to: MySQL table collation rules different error problem analysis, enterprise production MySQL optimization introduction, MYSQL subquery and nested query optimization instance analysis, etc. Please leave a message if you have any questions, and this site will reply to you in time. Thank you friends for your support to this site!


Related articles: