MariaDB 10.1.23中mariabackup是否支持部分备份与恢复?
Let’s break this down clearly for you:
First off, MariaDB 10.1.23 does not include mariabackup out of the box. The mariabackup tool was officially integrated into the MariaDB distribution starting with MariaDB 10.1.26 as a fork of Percona XtraBackup. So if you’re running 10.1.23, you won’t find mariabackup pre-installed with your server.
That said, you can achieve partial backup and restore for MariaDB 10.1.23 using Percona XtraBackup 2.4 (the upstream tool that mariabackup is based on). XtraBackup 2.4 fully supports MariaDB 10.1, including partial operations like:
- Backing up specific databases with the
--databasesflag (e.g.,xtrabackup --databases="db1 db2" --backup --target-dir=/backup/partial) - Backing up individual tables (requires
innodb_file_per_tableto be enabled, which is default in MariaDB 10.1) using--tablesor a table list file - Restoring specific databases/tables by preparing the backup, then copying the relevant files to your datadir (or using tablespace import for individual tables)
- Backing up specific databases with the
If you were considering using a newer version of mariabackup with 10.1.23, I’d strongly advise against it. Cross-version tool/server mismatches often lead to compatibility issues—think corrupted backup files, failed restores, or unexpected data inconsistencies. Stick to XtraBackup 2.4 for this server version.
For context: Once you upgrade to MariaDB 10.1.26 or later, the built-in mariabackup does support partial backup and restore operations, mirroring the functionality of XtraBackup. The process is nearly identical to using XtraBackup, with commands like
mariabackup --databases="mydb" --backupand corresponding restore steps.
Just make sure you have innodb_file_per_table enabled (check with SHOW VARIABLES LIKE 'innodb_file_per_table';) before attempting partial table restores—this is mandatory for being able to work with individual table spaces.
内容的提问来源于stack exchange,提问作者Qwentor

