MySQL Backup and Bin-log logs
Backup data: Mysqldimp-uroot-p test-l-F '/tmp/test.sql '
-L Read lock
-F that is flush logs, you can regenerate the log files, including, of course, log-bin logs.
View Bin-log logs with mysql>show master status;
Clear table data truncate tables;
Log recovery based on binary Bin-log
View Bin-log Logs
Mysqlbinlog--no-defaults mysql-bin.000002 | More to find the corresponding event according to the end_log_pos= location
Recovery format: Mysqlbinlog--no-defaults mysql-bin.000002 |mysql-uroot-p test
Recovery of MySQL Database
Recovery data: Mysql-uroot-p test-v-F </tmp/test.sql
-V View Import details
-F is when an error is encountered in the middle, you can skip the past, continue to execute the following statement
Restore based on End_log_pos node value
Mysqlbinlog--no-defaults--stop-posistion= "555" mysql-bin.000002|mysql-uroot-p test
Mysqldump+binlog to restore the complete process
Mysqlbinlog the following main parameters:
--stop-posistion= "100"
--start-position= "50"
--stop-date= "2012-10-10 21:12:12"
--start-date= "2012-10-10 21:12:12"
Backup and binary log recovery for MySQL database