Manual Recovery
If you want to restore all of the server’s data,because some data was inadvertently deleted by an SQL statement, a simple full recovery using the binary logs will only repeat the mistake. For such a situation,
run the mysqlbinlog and redirect results to a text file so that you can edit it before passing the file on to MySQL.To redirect the output from mysqlbinlog, you would enter as follows:
mysqlbinlog /var/log/mysql/bin.464442 > /tmp/mysql_restore.sql
This will create a simple text file in the /tmp directory that you can edit.After you’ve deleted the unwanted SQL statements and saved the restore file, you can then run it as follows:
mysql -u root -pmypwd –socket=/tmp/mysql_restore.sock < /tmp/mysql_restore.sql
The –socket option will temporarily name a different socket file for Unix systems.
