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

Mysql erroneous deletion of database how to recover

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article mainly explains "Mysql erroneous deletion database how to restore", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's train of thought slowly in depth, together to study and learn "Mysql erase database how to restore" it!

-mistakenly delete database recovery-

Backup point in time:

-- CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000211', MASTER_LOG_POS=12737491

Full recovery:

Mysql-uroot-p-h227.0.0.1/tmp/monitor_binlog211.sql

Mysqlbinlog-vvv mysql-bin.000212-- database=monitor > / tmp/monitor_binlog212.sql

Find out the operation of drop table

Grep-I "drop table" / tmp/monitor_binlog212.sql

Find out the incorrect update operation:

Mysqlbinlog-- no-defaults-vvv mysql-bin.000710-- database=ticket-- start-datetime= "2016-06-21 16:05:00" | grep-B 50'# UPDATE `ticket`.`cinema`' | more

Vi / tmp/monitor_binlog212.sql

/ DROP TABLE IF EXISTS "analysedubborequest"

# at 10970522

# 160525 11:42:23 server id 108 end_log_pos 10970597 CRC32 0x3ccef367 Query thread_id=162474 exec_time=0 error_code=0

SET timestamp 1464147743

BEGIN

/ *! * /

# at 10970597

# at 10970664

# at 10970886

# 160525 11:42:23 server id 108 end_log_pos 10970917 CRC32 0xd89947f3 Xid = 24254453

Com _ MIT _ blank /

# at 10970917

# 160525 11:42:26 server id 108 end_log_pos 10971065 CRC32 0x3c4914bf Query thread_id=168489 exec_time=0 error_code=0

Use `monitor` / *! * /

SET timestamp 1464147746

SET @ @ session.foreignments keyword checks0rachetti /

DROP TABLE IF EXISTS "analysedubborequest" / * generated by server * /

/ *! * /

# at 10971065

Note:

DROP TABLE IF EXISTS "analysedubborequest" / * generated by server * /

Delete operations in # at 10970917 (start-position) and end_log_pos 10971065 (stop-position) at this location

Incremental recovery:

Mysqlbinlog-- start-position='12737491' mysql-bin.000211-- database=monitor | mysql- uroot-p

Mysqlbinlog-- stop-position='10970522' mysql-bin.000212-- database=monitor | mysql- uroot-p

Other:

View binlog events:

Show binlog events in 'mysql-bin.000212'\ G

View based on point in time, not allowed

Mysqlbinlog-vvv mysql-bin.000212-startdatetime=' time'- stopdatetime=' time'- database=monitor

Thank you for your reading, the above is the content of "Mysql mistakenly deleted database how to restore", after the study of this article, I believe you have a deeper understanding of how to restore the Mysql mistakenly deleted database, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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