本文主要是介绍mysql centos xtrabackup,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
查看版本:
xtrabackup --version
检查是否安装成功:
mysql 小例子
https://blog.csdn.net/wowocpp/article/details/139501625
《Centos7——实战-完全备份和增量备份》
https://blog.csdn.net/weixin_45842014/article/details/109049759
CentoS7 安装篇十二:mysql主从搭建(xtrackbackup不停机搭建)
https://blog.csdn.net/chengxuyuanjava123/article/details/133854966
使用第三方工具percona-xtrabackup进行数据备份与恢复
https://blog.csdn.net/weixin_68398469/article/details/139335680
wget https://downloads.percona.com/downloads/Percona-XtraBackup-2.4/Percona-XtraBackup-2.4.26/binary/redhat/7/x86_64/percona-xtrabackup-24-2.4.26-1.el7.x86_64.rpmsudo yum localinstall -y ./percona-xtrabackup-24-2.4.26-1.el7.x86_64.rpm
xtrabackup --versionsocket=/var/lib/mysql/mysql.sock
全量备份
sudo xtrabackup --backup --target-dir=/opt/20240607 --user=root --password=1234aA~1 --socket=/var/lib/mysql/mysql.sock
#–backup:表示该操作为备份操作
#–target-dir:指定备份文件的路径,该路径下不能有任何的文件,否则会报错
#–user:备份的用户
#–password:该用户的密码
#–socket:指定socket启动文件路径 通常在:/var/lib/mysql/mysql.sock
全量备份
sudo innobackupex --user=root --password=1234aA~1 --no-timestamp /opt/20240606/
11
5.执行一次全备份xtrabackup --backup --target-dir=/data/backups/mysql/full_backup6.在全备份的基准上执行第一次增量备份xtrabackup --backup --target-dir=/data/backups/mysql_increase1 --incremental-basedir=/data/backups/mysql/full_backup7.往后的每一次增量备份都以上一次增量备份为基准xtarbackup --backup --target-dir=/data/backups/mysql_increase2 --incremental-basedir=/data/backups/mysql_increase2
添加内容
mysql -u root -p
1234aA~1
show databases ;
use company
show tables ;
insert into test(name) values (‘张三’), (‘李四’);
11
增加内容
sudo xtrabackup --backup --target-dir=/opt/full_backup --user=root --password=1234aA~1 --socket=/var/lib/mysql/mysql.sock
sudo xtrabackup --backup --target-dir=/opt/mysql_increase1 --incremental-basedir=/opt/full_backup --user=root --password=1234aA~1 --socket=/var/lib/mysql/mysql.sock
sudo xtrabackup --backup --target-dir=/opt/mysql_increase2 --incremental-basedir=/opt/mysql_increase1 --user=root --password=1234aA~1 --socket=/var/lib/mysql/mysql.sock
这篇关于mysql centos xtrabackup的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!