0

I have made a backup, then I have executed several statements, including a delete. So I have recovered the backup but I only want to recover the binary log until before the delete operation, what command can I use for this?

Anita JP
  • 23
  • 4
  • 1
    have you checked the manual https://dev.mysql.com/doc/refman/8.0/en/point-in-time-recovery-binlog.html – nbk Feb 12 '21 at 18:12
  • I found "mysqlbinlog --start-position=155 --stop-position=232 /var/lib/mysql/bin.123456 \ | mysql -u root -p" but i dont understand this: "/var/lib/mysql/bin.123456 \ |" – Anita JP Feb 12 '21 at 18:20
  • what did you don't understand, you find the position where the recovery shpould stop and set the end pont, that we can't help you with. the rest is linux specific but windows also has piping. so read the steps againcarfully it is all explained, and if you have a specific question maybe dba is a better palce for this. but your question is too briad – nbk Feb 12 '21 at 18:27
  • but is it the mysqlbinlog command that performs the recovery? only that? – Anita JP Feb 12 '21 at 18:41
  • 1
    yes the binlog command take the selected datadat and transfers it to the database that iot the last part after | – nbk Feb 12 '21 at 18:49
  • To be clear: `mysqlbinlog` itself does not apply changes to your database. The _output_ of `mysqlbinlog` is a stream of SQL statements, and you must use that like an SQL script, as the _input_ to `mysql`, the command-line client. You should read the documentation linked to above. – Bill Karwin Dec 06 '21 at 15:33

0 Answers0