解決Mysql主從同步的Last_IO_Errno:1236錯誤問題

來源:互聯網
上載者:User

從伺服器錯誤代碼:

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.'

大概分析了一下原因,個人認為很可能的因素的由於①mysql版本不同導致;②備份不完全導致的。之前配置版本相同的mysql是不存在這個問題的。(時間問題,沒有具體測試原因)

主伺服器由於上次php導致的宕機,升級到了最新版本的mysql(5.6.29),而從伺服器我剛剛編譯的時候使用的5.5.49這個版本的db,因此推斷可能是由於這個問題導致的,沒有去看官方文檔,只是個人猜測。
版本不同導致的另外一個問題是:

[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

我偷懶,直接重新編譯一個相同版本的mysql了事,具體原因和版本不同,沒有仔細研究。
slave臨時跳過錯誤方法:
MySQL


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

slave永久跳過錯誤的方法:


vi /etc/my.cnf
[mysqld]
slave-skip-errors=1062,1053,1146 #跳過指定error no類型的錯誤
#slave-skip-errors=all #跳過所有錯誤

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.