简介
- xtrabackup一款强大的在线热备份工具
- 备份过程中不锁库表,适合生产环境
- 由专业组织Percona提供(改进MySQL分支)
下载xtrabackup
xtrabackup官网地址:https://www.percona.com/
进去官网后,下滑到底部导航栏,点击底部的Downloads下载按钮,进入下载页面
下载地址:https://www.percona.com/downloads
下滑找到Percona XtraBackup
选择需要下载的版本,我这里下载的是8.0.32
选择完安装的版本和环境后,点击安装包的后面DOWNLOAD即可下载
部署xtrabackup
将已经下载的xtrabackup安装包上传至服务器
安装percona-xtrabackup(libev是依赖包)
dnf -y install libev
dnf -y localinstall percona-xtrabackup-80-8.0.32-25.1.el8.x86_64.rpm
问题:
出现以下问题,表示安装的版本有问题,版本不支持你当前的 MySQL 服务器版本,请重新选择下载正确的版本
XtraBackup 的版本通常需要匹配或接近 MySQL 的版本,以确保所有功能都能正确工作。
[root@mysql ~]# mkdir /db_all
[root@mysql ~]# xtrabackup --backup --user=root --password="123qqq...A" --target-dir=/db_all
2024-12-24T10:33:05.448928+08:00 0 [Note] [MY-011825] [Xtrabackup] recognized server arguments: --datadir=/var/lib/mysql
2024-12-24T10:33:05.449607+08:00 0 [Note] [MY-011825] [Xtrabackup] recognized client arguments: --backup=1 --user=root --password=* --target-dir=/db_all
xtrabackup version 8.0.32-25 based on MySQL server 8.0.32 Linux (x86_64) (revision id: 14f007fb)
241224 10:33:06 version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup' as 'root' (using password: YES).
241224 10:33:06 version_check Connected to MySQL server
241224 10:33:06 version_check Executing a version check against the server...# A software update is available:
241224 10:33:09 version_check Done.
2024-12-24T10:33:09.434824+08:00 0 [Note] [MY-011825] [Xtrabackup] Connecting to MySQL server host: localhost, user: root, password: set, port: not set, socket: not set
2024-12-24T10:33:09.567053+08:00 0 [ERROR] [MY-011825] [Xtrabackup] Unsupported server version 8.0.36
2024-12-24T10:33:09.567179+08:00 0 [ERROR] [MY-011825] [Xtrabackup] Please upgrade PXB, if a new version is available. To continue with risk, use the option --no-server-version-check.