16.3 服务器存储库选项

这些存储库选项指定与数据库服务器相关的各种参数,从中备份数据或将备份恢复到其中。

这些选项仅用于以下操作:

当数据库连接在备份期间可用时,描述源存储库的参数将被忽略,并被从数据库连接中检索到的相应值覆盖。

有关如何为 MySQL 服务器指定这些选项的信息,请单击选项名称以查看 MySQL 参考手册中的描述。

  • datadir=PATH

    这是datadirMySQL 实例使用的值。这些.frm文件位于以实例中的数据库命名的子目录中。

    当存在数据库连接时,会自动检索该值并覆盖您指定的任何值。这是 MySQL 服务器和 MySQL Enterprise Backup 的关键参数。

  • log-bin[= basename]

    对于 MySQL Enterprise Backup 4.1.2 及更高版本:指定要还原的二进制日志的位置。默认情况下,在还原期间,二进制日志将还原到它在备份服务器上找到的相同位置。使用此选项为二进制日志指定不同的目标位置。--log-bin该选项在确定二进制日志文件的位置和名称方面与 MySQL 服务器 的选项类似 ——有关详细信息,请参阅服务器 --log-bin 选项的描述。作为总结:

    • 在不提供 a 的情况下使用此选项 basename 会将二进制日志放入目标服务器的数据目录中,并使用默认的 basename host_name-bin

    • 在提供 a 时使用此选项 basename 会将二进制日志放入具有指定基本名称的目标服务器的数据目录中。

    • 在提供 basename 包含完整文件路径(例如 )的同时使用此选项会使用提供的基本名称 ( )/home/admin/db/binlogdir/binlog将二进制日志放在目标服务器上的指定文件夹 ( ) 中。 /home/admin/db/binlogdir/binlog

    该选项仅适用于 copy-back-and-apply-logand copy-back操作。将它与任何其他操作一起使用会使命令失败。

  • relay-log[= basename]

    For MySQL Enterprise Backup 4.1.2 and later: Specify the location for the relay log to be restored on a replica server. By default, during a restore for a replica server, the relay log is restored to the same location it was found on the backed-up replica server. Use this option to specify a different target location for the relay log. The option works similarly as the --log-bin option for mysqlbackup in determining the location and the name of the relay log—see description of the --log-bin option for details.

    The option is only for the copy-back-and-apply-log and copy-back operations. Using it with any other operations makes the command fail.

  • innodb_data_home_dir=PATH

    Specifies the directory where InnoDB data files reside. Usually the same as datadir, but can be different.

    This parameter, together with innodb_data_file_path=SIZE, determines where the InnoDB data files such as ibdata1, ibdata2, and so on, are situated within the MySQL server.

    For backups: Typically, you do not need to specify this option, because its value is retrieved automatically using the database connection. Specifies the option for an offline backup if the InnoDB data files do not reside under the server's data directory.

    For restores: The directory where InnoDB data files are to be restored. Specify the option only if the InnoDB data files are to be restored outside of the server's data directory. For release 4.1.3 and later: the specified directory must be non-existent or empty, or the restore operation will fail, even if the --force option is used.

    Its value is derived as follows:

    • If innodb_data_home_dir is not specified, it inherits the value of datadir.

    • If innodb_data_home_dir is a relative path, the path is located relative to (that is, underneath) the datadir value.

    • An innodb_data_home_dir of "" refers to the / root directory.

    • If innodb_data_home_dir is an absolute path, its value is used as-is.

  • innodb_data_file_path=VALUE

    Specifies InnoDB data file names and sizes. Examples:

    ibdata1:32M;ibdata2:32M:autoextend
    /abs/path/ibdata1:32M:autoextend
    innodb-dir/ibdata1:32M:autoextend

    When a database connection exists, the value is retrieved automatically and overrides any value you specify.

    This parameter together with innodb_data_home_dir determines where the InnoDB data files (such as ibdata1, ibdata2, and so on) reside in server repository.

    Typically, you do not need to specify this option, because its value is retrieved automatically using the database connection. If no database connection is available, you must specify it.

    Whether the initial file name begins with a / character or not, the files are located relative to the innodb_data_home_dir value.

  • innodb_log_group_home_dir=PATH

    Specifies where the InnoDB redo log reside within the server repository. Usually the same as datadir, but can be different.

    For backups: Typically, you do not need to specify this option, because its value is retrieved automatically using the database connection. Specifies the option for an offline backup if the InnoDB redo log files do not reside under the server's data directory.

    For restores: The directory where InnoDB redo log files are to be restored. Specify the option only if the InnoDB redo log files are to be restored outside of the server's data directory. For release 4.1.3 and later: the specified directory must be non-existent or empty, or the restore operation will fail, even if the --force option is used.

    Its value is derived as follows:

    • If innodb_log_group_home_dir is not specified, it inherits the value of datadir.

    • If innodb_log_group_home_dir is a relative path, the path is taken to be relative to (that is, underneath) the datadir value.

    • If innodb_log_group_home_dir is an absolute path, its value is used as-is.

  • innodb_log_files_in_group=N

    Specifies the number of InnoDB log files before being rotated.

    Typically, you do not need to specify this option, because its value is retrieved automatically using the database connection. If no database connection is available, you must specify it.

    When a database connection exists, the value is retrieved automatically and overrides any value you specify.

  • innodb_log_file_size=SIZE

    Specifies maximum single InnoDB log file size before switching to next log file. Example: 20M.

    Typically, you do not need to specify this option, because its value is retrieved automatically using the database connection. If no database connection is available, you must specify it.

    When a database connection exists, the value is retrieved automatically and overrides any value you specify.

  • innodb_page_size=SIZE

    Specifies the page size for all InnoDB tablespaces.

    Typically, you do not need to specify this option, because its value is retrieved automatically using the database connection. If no database connection is available, you must specify it.

    When a database connection exists, the value is retrieved automatically and overrides any value you specify.

  • innodb_undo_directory=PATH

    Specifies where the InnoDB undo log reside within the server repository. Usually the same as datadir, but can be different.

    For backups: Typically, you do not need to specify this option, because its value is retrieved automatically using the database connection. Specifies the option for an offline backup if the InnoDB undo log files do not reside under the server's data directory.

    For restores: The directory where InnoDB undo log files are to be restored. Specify the option only if the undo log files are to be restored outside of the server's data directory. For release 4.1.3 and later: the specified directory must be non-existent or empty, or the restore operation will fail, even if the --force option is used.

    Its value is derived as follows:

    Warning

    When using this option, make sure the undo log location does not change between successive restores of a full and an incremental backups, or of two incremental backups. Otherwise, the restore is going to fail.

  • innodb_checksum_algorithm=NAME

    Specifies the name of the checksum algorithm used for validating InnoDB tablespaces. Default is innodb.

    Typically, you do not need to specify this option, because its value is retrieved automatically using the database connection. If no database connection is available, you must specify it.

    When a database connection exists, the value is retrieved automatically and overrides any value you specify.

  • innodb_buffer_pool_filename=FILENAME

    The file produced on the server when innodb_buffer_pool_dump_at_shutdown (enabled by default on MySQL 5.7.7 and after) or innodb_buffer_pool_dump_now is enabled. It holds the list of tablespace IDs and page IDs of the server's buffer pool.

    Typically, you do not need to specify this option, because its value is retrieved automatically using the database connection. If no database connection is available during backup, you must specify it.

    When a database connection exists, the value is retrieved automatically and overrides any value you specify.