應用太大的MySQL binlog

應用太大的MySQL binlog

我正在嘗試恢復 MySQL 崩潰。我有截至週一的資料和此後的二進位日誌,並且希望應用二進位日誌,因為組合將是一組完整的資料。問題在於二進位日誌被當作單一資料包讀取。我的有的太大了,達到2.4G,而MySQL只允許max_allowed_packet=1G(1073741824)。有什麼方法可以將它們分塊或以其他方式分開嗎?

編輯:我現在嘗試了splitLinux 命令,該命令在每個分割檔案的第二個和後續檔案上給出了「錯誤的幻數」錯誤。讀完後,這是有道理的。我現在嘗試使用mysqlbinlog --start-position 4 --stop-position 200000003 $1 > $1.binout這樣我可以使用帶有增​​量的循環,但它不會在邊界上結束:

WARNING: The range of printed events ends with a row event or a table map event that does not have the STMT_END_F flag set. This might be because the last statement was not fully written to the log, or because you are using a --stop-position or --stop-datetime that refers to an event in the middle of a statement. The event(s) from the partial statement have not been written to output.

當我增加下一個循環時,有沒有辦法確定真正的開始位置是什麼?此範例以 199994536 結束。

相關內容