To ensure the integrity of the backup data, MySQL Enterprise Backup provides avalidate command for validating a backup by the checksum values of its data pages after the backup is created or transferred to another system.
mysqlbackup [STD-OPTIONS] [--backup-dir=PATH][--backup-image=IMAGE] [MESSAGE-LOGGING-OPTIONS] [PROGRESS-REPORT-OPTIONS] [CLOUD-STORAGE-OPTIONS] validateVerifies that a backup is not corrupted, truncated, or damaged. This operation validates the checksum value for each data page in a backup.
To avoid spending excessive time and resources on files that are too heavily corrupted,mysqlbackup stops validating a .ibd file after more than twenty corrupted pages are found in it, and proceeds to the next file instead. In that case, the operation's summary will not give a full count of corrupted pages, but only says“at least 20 pages are corrupted.”
The operation also has the following limitations:
If any
.ibdfiles or.sdifiles are missing from the data directory during a backup or have been deleted from a backup after the backup was made, thevalidateoperation will not be able to detect the problem.If a backup has been corrupted by removing or truncating pages from any of the .ibd files inside , the
validateoperation will not be able to detect the problem.For any backup directory, the operation can only validate the InnoDB data files (
ibdata*and*.ibdfiles) in it. Problems with other file types within a backup directory (for example,.sdifile corruptions) are not detected.For MySQL Enterprise Backup 8.0.20 and earlier only: During a
validateoperation, ifmysqlbackup encounters any encrypted InnoDB tablespaces, it issues a warning and then skips over them.
Here is a sample command for validating a backup image:
mysqlbackup -uroot --backup-image=/logs/fullimage.mi validateAdvanced: Here is a sample command for validating a backup directory:
mysqlbackup -uroot --backup-dir=/logs/backupext validate For more usage examples for thevalidate command, seeSection 4.2.3, “Verifying a Backup”