当前位置:网站首页>xtrabackup做数据备份
xtrabackup做数据备份
2022-06-24 07:04:00 【一个不靠谱的程序员】
xtrabackup
XtraBackup(PXB) 工具是 Percona 公司用 perl 语言开发的一个用于 MySQL 数据库物理热备的备份工具,支持 MySQl(Oracle)、Percona Server 和 MariaDB,并且全部开源,真可谓是业界良心。阿里的 RDS MySQL 物理备份就是基于这个工具做的。由于是采取物理拷贝的方式来做的备份,所以速度非常快,几十G数据几分钟就搞定了,而它巧妙的利用了mysql 特性做到了在线热备份,不用像以前做物理备份那样必须关闭数据库才行,直接在线就能完成整库或者是部分库的全量备份和增量备份。
安装
安装仓库Install the Percona repository
yum install http://www.percona.com/downloads/percona-release/redhat/0.1-6/percona-release-0.1-6.noarch.rpm测试一下仓库里是否含有最新版的资源
yum list | grep percona安装packages
yum install percona-xtrabackup-24
数据备份
- 全量备份
innobackupex ----defaults-file=/etc/my.cnf --user=root --password=root /root/back
数据恢复
关闭数据库服务
service mysql stop执行数据恢复命令*(注意my.cnf里配置的datadir目录必须是一个空目录,因此在恢复数据之前,要先datadir到别的目录,然后新建一个空目录再执行恢复)
innobackupex --defaults-file=/etc/my.cnf --copy-back --rsync /path/to/backup给新建的目录变更权限
chown -R mysql. /app/mysql/data启动mysql服务
service mysql start
边栏推荐
- JS merge multiple objects and remove duplicates
- Redis的Cluster集群数据倾斜
- pyQt 中 QMenu 响应
- "Adobe international certification" Photoshop software, about drawing tutorial?
- QTimer定时器不起作用的原因
- Shell basic operator -- arithmetic operator
- DHCP, TFTP Foundation
- Review SGI STL secondary space configurator (internal storage pool) | notes for personal use
- 分布式 | 如何与 DBLE 进行“秘密通话”
- leetcode 1642. Furthest Building You Can Reach(能到达的最远的建筑)
猜你喜欢
![Fundamentals of 3D mathematics [17] inverse square theorem](/img/59/bef931d96883288766fc94e38e0ace.png)
Fundamentals of 3D mathematics [17] inverse square theorem

2022 mobile crane driver special operation certificate examination question bank and online simulation examination

ZUCC_ Principles of compiling language and compilation_ Experiment 08 parsing LR parsing

Maya re deployment

ZUCC_ Principles of compiling language and compilation_ Experiment 04 language and grammar

Permission model DAC ACL RBAC ABAC

jwt(json web token)

【无标题】

Question 4 - datepicker date selector, disabling two date selectors (start and end dates)

ZUCC_ Principles of compiling language and compilation_ Experiment 03 getting started with compiler
随机推荐
JUC personal simple notes
js中通过key查找和更新对象中指定值的方法
Common misconceptions in Tencent conference API - signature error_ code 200003
Qmenu response in pyqt
2021-03-16 comp9021 class 9 notes
ZUCC_ Principles of compiling language and compilation_ Experiment 01 language analysis and introduction
QT writing security video monitoring system 36 onvif continuous movement
Common CVM transcribes audio using virtual sound card
Micro build low code online "quick registration applet" capability
OpenCV get(propId) 常用的值
Qt导出PDF文件的两种方法
Final review and key points of software process and project management
2021-03-11 comp9021 class 8 notes
JS scroll div scroll bar to bottom
ZUCC_编译语言原理与编译_大作业
Application of tidb in Netease games
12-- merge two ordered linked lists
Shell basic operator -- arithmetic operator
ZUCC_ Principles of compiling language and compilation_ Experiment 03 getting started with compiler
Two methods of QT exporting PDF files