Database disaster recovery

Data is the most important, so regular backup is very important. This article uses mysql, so it is necessary to use mysql's binlog for backup, and then combine with linux's scheduled task crontab to export database cold backup. You can type commands, but it is relatively convenient to operate in the graphical interface. Can refer to

1. Backup logs and enable binlog (default disabled):

View through mysql> show variables like 'log_%';

If the binlog option is OFF, add log-bin=D:/Mysql/binlog/mysql-bin.log to the configuration file. Note that the windows and linux configuration files and paths are different.

2. Cold backup:

mysqldump exports backup data ( transactions are enabled by default , all tables are locked, and all table operations are blocked). At the same time, the export command plus a new log file can ensure that the new binlog log is recorded after the export.

3. Recovery:

For specific situations, for example, restore the data from the cold backup first, and then find the binlog logs after the specific backup and restore them to the specified location one by one.

 

specific operation. to be continued...

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326460389&siteId=291194637