应用过大的 MySQL binlog

应用过大的 MySQL binlog

我正在尝试恢复 MySQL 崩溃。我有截至周一的数据和自那时以来的 binlog,并且想应用 binlog,因为组合起来将是完整的数据集。问题是 binlog 是作为单个数据包读取的。我的一些 binlog 太大,高达 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 结束。有没有办法检测生成的 binlog 的最后位置?

相关内容