Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the problems that should be paid attention to when recovering data by mysqlbinlog command?

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail what you should pay attention to about the mysqlbinlog command to recover data. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

1. Do not use the base64-output=decode-rows parameter

-- base64-output=decode-rows is mainly used when parsing or viewing ROW-level binlog logs. Do not use this parameter when performing SQL.

For example:

/ usr/local/mysql-8.0.13/bin/mysqlbinlog mysql-bin.000004 | mysql- uroot-pendant 123456'

Or

/ usr/local/mysql-8.0.13/bin/mysqlbinlog mysql-bin.000004 > / tmp/rollback.sql

Mysql-uroot-pendant 123456'

< /tmp/rollback.sql 2.是否应该使用--skip-gtids=true参数 第一种情况: 如果我们是要恢复数据到源数据库或者和源数据库有相同 GTID 信息的实例,那么就要使用该参数。如果不带该参数的话,是无法恢复成功的。 # /usr/local/mysql-8.0.13/bin/mysqlbinlog --skip-gtids=true mysql-bin.000001 |mysql -uroot -p 或者 # /usr/local/mysql-8.0.13/bin/mysqlbinlog --skip-gtids=true mysql-bin.000001 >

Rollback.sql

Mysql-uroot-pendant 123456' < rollback.sql

The second situation:

If you are restoring to the database of another instance and do not contain the GTID information of the source instance, you can recover successfully with or without using this parameter.

This is the end of the article on "what should be paid attention to in mysqlbinlog command data recovery". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report