我有一个启用了二进制日志记录的系统,并且我每晚执行一次mysqldump (单事务,所有InnoDB)。如果我想要执行时间点恢复,我如何知道从二进制日志中的哪个点开始前滚?例如。
bin-log.000001包含dump.sql文件之前和之后的所有更改。如果我这样做了:
mysql < dump.sql要使用以下命令恢复到上次完整导出,然后前滚到最新的点,请执行以下操作:
mysqlbinlog bin-log.000001 | mysqlMySQL会知道从哪里开始吗?
发布于 2013-10-31 21:13:39
所以,是的,更多的研究让我找到了here。以防其他人想知道。
发布于 2013-10-31 21:24:35
查看mysqlbinlog的用法:
--stop-datetime=name
Stop reading the binlog at first event having a datetime
equal or posterior to the argument; the argument must be
a date and time in the local time zone, in any format
accepted by the MySQL server for DATETIME and TIMESTAMP
types, for example: 2004-12-25 11:25:56 (you should
probably use quotes for your shell to set it properly).看起来就是你想要的。
https://stackoverflow.com/questions/19706094
复制相似问题