压缩备份与恢复
压缩备份与恢复
# 压缩备份(qpress 算法)
xtrabackup --backup --user=backup --password='***' \
--target-dir=/data/backup/full_c --compress --compress-threads=4
# 恢复前解压
xtrabackup --decompress --target-dir=/data/backup/full_c --parallel=4
# 加密备份(AES256)
xtrabackup --backup --user=backup --password='***' \
--target-dir=/data/backup/full_e --encrypt=AES256 \
--encrypt-key-file=/etc/mysql/backup.key
xtrabackup --decrypt=AES256 --encrypt-key-file=/etc/mysql/backup.key \
--target-dir=/data/backup/full_e密钥文件与备份分机存放;解密后记得清理残留明文文件。