In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The simulation database is × ×, resulting in the recovery operation after the database is deleted.
1. Let's start with a full list:
Mysqldump-uroot-pgq266566-A-master-data=2 > all.sql
two。 Simulate the online production environment. There will be new changes after the backup.
3. Then simulate the database by × ×. Chain_web has been deleted.
4. If you find that it has been deleted online, first restore the chain_ web library with backup. Mysql-uroot-p123456-o chain_web
< all.sql 只恢复chain_web库。 恢复到备份时候的状态。 5.根据备份时候的--master-data=2 找到 position位置 在all.sql备份文件中。 6.从备份位置解析binlog mysqlbinlog --no-defaults -v -v --base64-output=decode-rows --start-position=194 mysql-bin.000009 >Test.sql
-- base64-output parameter is used to control whether the binlog part is displayed. If specified as decode-rows, it means that the binglog part is not displayed.
Find the location of the drop.
You can see that it's 8029.
Then parse the binlog based on these two locations:
Mysqlbinlog-start-position=194-stop-position=8029 mysql-bin.000009-database=chain_web > test4.sql
When parsing binlog, add-- no-defaults-v-v-- base64-output=decode-rows parameter to see a more intuitive sql, but it will not be able to import the database. You can first add parameter parsing to check the parsing result to confirm that there is no problem, then parse without adding parameters, and then import it into the corresponding library. If GTID is enabled, add the parameter-- skip-gtids=true) when parsing)
(--datebase=chain_web means that only the operation of the chain_ web library is parsed because only the chain_ weblibrary chain library is deleted and there is no operation. There is no need to parse the binlog, otherwise the import will report a primary key conflict.)
Vim test4.sql can see that there are no drop statements. Then you can import it into the database.
Mysql-uroot-p123456 chain_web < test4.sql
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.