ITPub博客

首页 > 数据库 > MySQL > 【Mysql】mysql闪回flashback-5.7

【Mysql】mysql闪回flashback-5.7

原创 MySQL 作者:小亮520cl 时间:2016-12-15 11:00:59 0 删除 编辑
工具链接:http://pan.baidu.com/s/1hrU3hgK

1.首先确认误操作的位置

2.使用工具闪回
  1. [root@Yun-MySQL02 lib64]#/soft/mysqlbinlog -vv  --start-position=331 -B  --skip-gtids /databak/3306/mysql-bin.000043|/usr/local/mysql/bin/mysql -uroot -p`cat /etc/sqlpass ` -P3306 -h127.0.0.1 test  
  2. ---如果开启了gtid的最好使用skip-gtids 不然会报错
  [root@Yun-MySQL02 lib64]# /usr/local/mysql/bin/mysql -uroot -p`cat /etc/sqlpass ` -P3306 -h127.0.0.1 test<re.sql 
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1782 (HY000) at line 11: @@SESSION.GTID_NEXT cannot be set to ANONYMOUS when @@GLOBAL.GTID_MODE = ON.


如果报

/usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found

参考文档:https://www.aliyun.com/zixun/content/2_6_518744.html
</re.sql 


另外一个工具 binlog2sql
https://github.com/danfengcao/binlog2sql
  1. binlog2sql 的一些改进:
  2. 在测试时--stop-never在qa环境没有作用,添加了在 BinLogStreamReader 实例里面加入 blocking=True 来保证源源不断的接受binlog而不中断。

  3. 另外也加入了更改目标库名的功能,比如原库叫d_my1,生成的sql目标库名是 d_my2 。

  4. http://seanlook.com/2017/09/05/mysql-binlog-subscribe-simple-for-dba/




其他参数参考:http://www.innomysql.com/article/25769.html

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29096438/viewspace-2130644/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
毕业以后专业任职数据库工程师职位,itpub一直作为自己的笔记记录的地方,blog写的不详细,草书笔记,仅供参考!

注册时间:2013-09-12

  • 博文量
    529
  • 访问量
    1126954