mysqlbinlog備份時候報錯Sanity check failed

來源:互聯網
上載者:User

mysqlbinlog備份時候報錯Sanity check failed

今天在複習MySQL的二進位日誌時候,發現出了點問題,如下:
mysqlbinlog -uroot -proot /usr/local/mysql/data/node1.000004 --start-datetime="2016-05-04 13:30:00" --stop-datetime="2016-05-04 13:45:00" > a.sql

ERROR: Error in Log_event::read_log_event(): 'Sanity check failed', data_len: 171, event_type: 30
ERROR: Could not read entry at offset 1009: Error in log format or read error.

查了下網上的說明,說是當前環境變數下的mysqlbinlog的版本和當前MySQL的版本不一樣導致的。只要加全域路徑即可。【說明:我以前在這台虛擬機器上安裝過MariaDB10.0.12,後來換成了MySQL5.6】
如下:

/usr/loca/mysql/bin/mysqlbinlog -uroot -proot /usr/local/mysql/data/node1.000004 --start-datetime="2016-05-04 13:30:00" --stop-datetime="2016-05-04 13:45:00" > a.sql

這樣就能正確的執行備份了。

mysqlbinlog解析binlog亂碼問題解密

使用mysqlbinlog提取二進位日誌

使用mysqlbinlog工具進行基於位置或時間點的恢複 

有關binlog的介紹與描述請參考:MySQL 二進位日誌(Binary Log) 

本文永久更新連結地址:

相關文章

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.