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

Point-in-time based recovery

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. Copy the binlog of the old library to the recovery library (be careful not to overwrite the log of the new library)

2. Parse binlog to find out the time point of at:

Mysqlbinlog-vv mysql-bin.000001:

# at 3535

# 160524 9:57:58 server id 16205624 end_log_pos 3626 CRC32 0xa7cedf84 Query thread_id=11 exec_time=0 error_code=0

Use `test` / *! * /

SET timestamp 1464055078

/ *!\ C latin1 * /! * /

SET @ @ session. Session. Session setting client.session. Session. Collationalization connections8 session. Session. Collationalization server33.

Create table t10 like t1

/ *! * /

# at 3626

# 160524 9:58:10 server id 16205624 end_log_pos 3698 CRC32 0xfec0431d Query thread_id=11 exec_time=0 error_code=0

SET timestamp 1464055090

BEGIN

/ *! * /

# at 3698

# 160524 9:58:10 server id 16205624 end_log_pos 3744 CRC32 0x0aa287fa Table_map: `test`.`t10` mapped to number

# at 3744

# 160524 9:58:10 server id 16205624 end_log_pos 3799 CRC32 0x39ec7657 Write_rows: table id 107 flags: STMT_END_F

BINLOG'

MrVDVxM4R/cALgAAAKAOAAAAAGsAAAAAAAEABHRlc3QAA3QxMAABAwAA+oeiCg==

MrVDVx44R/cANwAAANcOAAAAAGsAAAAAAAEAAgAB//4BAAAA/gIAAAD+AwAAAP7JAAAAV3bsOQ==

'/ *! * /

# INSERT INTO `test`.`t10`

# SET

# @ 1room1 / * INT meta=0 nullable=0 is_null=0 * /

# INSERT INTO `test`.`t10`

# SET

# @ 1room2 / * INT meta=0 nullable=0 is_null=0 * /

# INSERT INTO `test`.`t10`

# SET

# @ 1room3 / * INT meta=0 nullable=0 is_null=0 * /

# INSERT INTO `test`.`t10`

# SET

# @ 1room201 / * INT meta=0 nullable=0 is_null=0 * /

# at 3799

# 160524 9:58:18 server id 16205624 end_log_pos 3830 CRC32 0x4870e01d Xid = 323

Com _ MIT _ blank /

# at 3830

# 160524 9:58:18 server id 16205624 end_log_pos 3945 CRC32 0xd22c27fc Query thread_id=11 exec_time=0 error_code=0

SET timestamp 1464055098 Universe /

DROP TABLE `t3` / * generated by server * /

/ *! * /

# at 3945

# 160524 9:58:51 server id 16205624 end_log_pos 4021 CRC32 0x3a14cd61 Query thread_id=6

3. Restore data (be sure to include use test or you don't know which library to plug into). :

Mysqlbinlog mysql-bin.000006-- start-position=3535-- stop-position=3830 | mysql- uroot-p123456-S / tmp/mysql5630.sock

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