It looks like a strong mysql backup policy, which is claimed to be invincible. Haha, please refer to any of your friends who need it.
It looks like a strong mysql backup policy, which is claimed to be invincible. Haha, please refer to any of your friends who need it.
Dump is performed at every day to back up the corresponding database, and binlog files of the corresponding database are updated.
If a database error is found, you only need to recover the previous dump backup and then restore the binlog file of the current day.
Example:
Run the following command at every day:
The Code is as follows:
Mysqldump database -- flush-logs-uroot-p -- opt> database_20020601. SQL
Executed according to the date rule.
If you want to restore the database to this morning, then:
1. Complete backup of the entire database
The Code is as follows:
Cd/var/lib/mysql
Mysqldump-uroot-p123456 mydata> mydata. bak
2. Delete the database backed up
The Code is as follows:
Rm-rf mydata
3. Recover with dump
The Code is as follows:
Mysql-uroot-p123456
Mysql database-uroot-p123456 <database_20020601. SQL
4. Use binlog for time-based recovery
The Code is as follows:
Mysqlbinlog -- stop-date = "10:18:49"/var/lib/mysql/mysql-bin.000006 | mysql-uroot-p123456
Note:
1. It is best to save the dump backup and binlog backup in remote-remote backup.
2. mysql master-slave replication.