1.3.2 Files Backed up for InnoDB Data

The InnoDB-related data files that are backed up include the ibdata* files (which represent the system tablespace and possibly the data for some user tables), any .ibd files (which contains data from user tables created with the file-per-table setting enabled), and the data extracted from the ib_logfile* files (the redo log information representing changes that occur while the backup is running), which is stored in a new backup file ibbackup_logfile.

如果您使用压缩备份功能, .ibd文件将以压缩形式重命名为.ibz 文件

The files, as they are originally copied, form a raw backup that requires further processing before it is ready to be restored. You then run the apply step (either as part of a copy-back-and-apply-log command or a backup-and-apply-log command, or as a separate apply-log command), which updates the backup files based on the changes recorded in the ibbackup_logfile file, producing a prepared backup. At this point, the backup data corresponds to a single point in time. The files are now ready to be restored, or for some other uses such as testing, reporting, or deployment as a replica.

要将 InnoDB 表恢复到其原始状态,您还必须具有相应的.frm 文件以及备份数据。 否则,如果自备份以来有人运行 ALTER TABLE或语句,表定义可能会丢失或过时。DROP TABLE默认情况下, mysqlbackup在备份操作期间自动复制 .frm文件并在恢复操作期间恢复文件。

笔记

为避免繁忙数据库备份期间出现并发问题,您可以使用--only-innodb--only-innodb-with-frm选项仅备份 InnoDB 表和相关数据。