You can check the integrity of your backup using the
validate command. The following is a
sample command for validating an encrypted backup image and the
output for the successful validation:
$ mysqlbackup –backup-image=/meb/backups/image.mbi --decrypt --key-file=/meb/enckeyfile validate 140219 11:22:44 mysqlbackup: INFO: Validating image ... /logs/img.bi 140219 11:22:44 mysqlbackup: INFO: Validate: [Dir]: meta 140219 11:22:45 mysqlbackup: INFO: Total files as specified in image: 44 mysqlbackup: INFO: datadir/tpch/tabnorm7.ibd Validated... mysqlbackup: INFO: datadir/tpch/tabnorm8.ibd Validated... mysqlbackup: INFO: datadir/tpch/tabnorm9.ibd Validated... ................ 140219 11:22:45 mysqlbackup: INFO: Validate operation completed successfully. 140219 11:22:45 mysqlbackup: INFO: Backup Image validation successful. mysqlbackup: INFO: Source Image Path = /logs/img.bi mysqlbackup completed OK!
This is a sample output for a checksum mismatch in the header:
mysqlbackup: ERROR: Checksum mismatch. Computed checksum: ### Checksum in image: ### mysqlbackup: ERROR: Problem verifying checksum of initial header of backup image. Image Path = /meb/backups/image.mbi mysqlbackup: ERROR: Backup image validation failed.
This is a sample output for an image containing corrupted
mysqlbackup: ERROR: datadir/db2/bigtab1.ibd has corrupt page number : 64 page number from page header : 64 mysqlbackup: ERROR: datadir/db2/bigtab1.ibd is corrupt and has : 10 corrupt pages mysqlbackup: ERROR: datadir/db2/t1.ibd has corrupt page number : 4 page number from page header : 0 ....... mysqlbackup: ERROR: datadir/db2/t1.ibd is corrupt and has : 5 corrupt pages mysqlbackup: ERROR: datadir/ibdata1 has corrupt page number : 63 page number from page header : 63 mysqlbackup: ERROR: datadir/ibdata1 has corrupt page number : 7 page number from page header : 7 .......... mysqlbackup: ERROR: datadir/ibdata1 is corrupt and has : 10 corrupt pages mysqlbackup failed with errors!
This is a sample output for a successful validation for a compressed backup directory
mysqlbackup: INFO: /backups/backup-dir/datadir/tpch/tabnorm5.ibz Validated... mysqlbackup: INFO: /backups/backup-dir/datadir/tpch/tabnorm6.ibz Validated... mysqlbackup: INFO: /backups/backup-dir/datadir/tpch/tabnorm7.ibz Validated... mysqlbackup: INFO: /backups/backup-dir/datadir/tpch/tabnorm8.ibz Validated... mysqlbackup: INFO: /backups/backup-dir/datadir/tpch/tabnorm9.ibz Validated... mysqlbackup: INFO: /backups/backup-dir/datadir/tpch/tabrowformat.ibz Validated... 140219 11:22:45 mysqlbackup: INFO: Validate backup directory operation completed successfully.
Furthermore, you can also verify that your backup has been
successful by restoring the backup data on a different server
and run the MySQL daemon (mysqld) on the new
data directory. You can then execute
statements to verify the database and table structures, and
execute queries to verify further details of the database. See
Section 4.2.3, “Restoring a Database” for basic steps for
restoring a backup, and see Chapter 5, Recovering or Restoring a Database for more
detailed instructions. Running the mysqld
daemon on the restored data requires a valid configuration file,
which you specify with the
--defaults-file option of the
mysqld command. You can reuse most of the
settings from the original
my.cnf file of
the backed up MySQL instance, combined with the settings from
backup-my.cnf file, which was created
in the temporary directory you specified with
--backup-dir when you created a
single-image backup (see Section 4.2.1, “Backing Up an Entire MySQL Instance”)
and contains a small subset of parameters required by
mysqlbackup. Create a new configuration file
by concatenating the two files mentioned above into a new one,
and use that file on the server on which you perform the
verification. Edit the file to make sure the
datadir parameter points to the right
location on the verification server. Edit the values for port,
socket, and so on if you need to use different connection
settings on the verification server.
Do not try to verify a backup by using the backup directory a data directory to start a MySQL server. This will crash the server, and might also corrupt your backup. See Appendix A, Frequently Asked Questions for MySQL Enterprise Backup.