MySQL Database Backup Types and common backup tools (1)
1. Database Backup Type
There are four backup types based on the database size, which are used in different scenarios. The following is a brief introduction:
1.1 full backup
This is a common method for most people. It can back up the entire database, including user tables, system tables, indexes, views, stored procedures, and other database objects. However, it requires more time and space. Therefore, we recommend that you perform a full backup once a week.
1.2 transaction log backup
The transaction log is a separate file that records database changes. During backup, you only need to copy the changes made to the database since the last backup. Therefore, it takes only a small amount of time. To make the database more robust, we recommend that you back up transaction logs hourly or even more frequently.
1.3 differential backup
It is also called Incremental backup. It is another way to back up only a part of the database. It does not use transaction logs. Instead, it uses a new image of the entire database. It is smaller than the original full backup because it only contains the database changed since the last full backup. It has the advantage of fast storage and recovery. We recommend that you perform differential backup once a day.
1.4 file backup
The database can be composed of many files on the hard disk. If the database is very large and cannot be backed up in one night, you can use file backup to back up part of the database every night. Generally, the database is not large enough to use multiple file storage, so this backup is not very common.
The database status can be divided into three types:
1. Cold backupAt this time, the database is closed, which can better ensure the integrity of the database.
2. Hot BackupThe database is running. This method relies on the [1] log file of the database for backup.
3. Logical backup, Use the software to extract data from the database and write the results to a file.