Mysql从binlog恢复
我们如何才能使一个数据库从一个二进制日志文件恢复迄今为止的日期,例如“周日到周三”?
谢谢,
佩德罗
How can we make one database restore date to date, like "sunday to wednesday" but from one binlog file?
Thanks,
Pedro
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
mysqlbinlog
。要指定开始和结束日期,请使用--start-datetime
和--stop-datetime
参数;它们记录在 MySQL 手册的mysqlbinlog
页面上。You can use
mysqlbinlog
. To specify start and end dates, use the--start-datetime
and--stop-datetime
arguments; they are documented on themysqlbinlog
page in the MySQL Manual.您需要首先恢复您要恢复到的点之前的最后一个完整备份。然后从该点重播二进制日志(备份可能应该已创建包含二进制日志位置 - 如果没有,您将必须尝试解决它),直到您想要恢复到的点。
You need to first restore your last full backup which was before the point you want to restore to. Then replay the binlogs from that point (The backup should probably have been created containing the binlog position - if not you'll have to try to work it out) up to the point you want to restore to.