mariadb 10.8.3 使用如下命令备份:
mariabackup --backup --stream=xbstream \
--host=${MARIADB_HOST} --port=${MARIADB_PORT} \
--user=${MARIADB_BACKUP_USER} --password=${MARIADB_BACKUP_PASSWORD} \
--extra-lsndir=backup_base | gzip > backup_base.gz
报错,并且 backup_base.gz
为空:
[00] 2022-07-26 01:56:55 Error: cannot process redo log before MariaDB 10.8
mariadb 服务端也会提示:
[Warning] Aborted connection 3 to db: 'unconnected' user: 'backup' host: '172.18.0.3' (Got an error reading communication packets)
已单独创建了备份账户,并分配了权限:
CREATE USER 'backup'@'172.18.%.%' IDENTIFIED BY 'mypassword';
GRANT RELOAD, PROCESS, LOCK TABLES, BINLOG MONITOR ON *.* TO 'backup'@'172.18.%.%';
使用的是如下的 docker-compose 文件启动的本地 mariadb 进行的测试
services:
mariadb:
image: "mariadb:10.8.3"
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_520_ci --skip-character-set-client-handshake
cap_add:
- SYS_NICE # CAP_SYS_NICE
environment:
MARIADB_ROOT_PASSWORD: ********
大家有用过 mariabackup 备份的吗?该如何才能正常备份呢?谢谢大家 🙏🏻