處理slave(低版本)複製master(高版本)產生的error 1236

背景知識: mysql

mysql 5.6里加入了replication event checksum(主從複製事件校驗)功能,此特性能較爲容易的判斷出是由何種緣由致使的主從數據不一致。 sql

處理過程: 性能

// 因某些特別的需求,須要對一臺mysql 5.6的master配置一個mysql 5.5的slave(不推薦)。 spa

mysql> start slave;
Query OK, 0 rows affected (0.00 sec)

mysql> show slave status \G
*************************** 1. row ***************************
......
             Slave_IO_Running: No
            Slave_SQL_Running: Yes
......           
        Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
                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.000990' at 661485030, the last event read from './mysql-bin.000990' at 661485030, the last byte read from './mysql-bin.000990' at 120.'
               Last_SQL_Errno: 0
               Last_SQL_Error: 
  Replicate_Ignore_Server_Ids: 
......

// 開啓slave時報error 1236,處理方法: code

# on Master: 事件

mysql> show variables like 'binlog_checksum%';
+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| binlog_checksum | CRC32 |
+-----------------+-------+
1 row in set (0.00 sec)

mysql> set global binlog_checksum='NONE';
Query OK, 0 rows affected (0.22 sec)

mysql> show variables like 'binlog_checksum%';
+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| binlog_checksum | NONE  |
+-----------------+-------+
1 row in set (0.00 sec)

注:在修改"bingo_checksum"後,若是原先在slave上使用的是mysqldump導出的數據副本進行的數據導入,那麼須要使用mysqldump(須要獲得master log pos,在slave上導出時使用'--dump-slave=2')從新生成一份 "bingo_checksum"修改後的sql文件去slave上進行數據導入。 it

相關文章
相關標籤/搜索