Get the App
SLTechnology News&Howtos  ›  Database  › 

Restore using XtraBackup | backup Mysql database-data recovery section

Shulou Source: shulou.com Published: 2022-06-01 17:01:46 10月03日 Update

Data recovery section

Introduction to the XtraBackup tool:

Now we often take into account the growth of the amount of data when we backup MySQL. When the amount of data is small, using mysqldump, as the amount of data becomes larger and larger, mysqldump is not appropriate. The first does not support incremental backup, and the second is slow to restore. It is recommended to use Percona's XtraBackup.

A brief introduction to the hot backup tool XtraBackup, which is a hot backup tool released by Percona, which does not affect data read and write operations during backup, and is an alternative to the commercial tool HotBackup (now it should be called MySQL Enterprise Backup, which can back up not only InnoDB but also MyISAM, etc.)

XtraBackup has two tools: xtrabackup and innobackupex.

Xtrabackup itself can only back up InnoDB and XtraDB, not MyISAM.

Innobackupex itself is modified by the Hot Backup script, and both MyISAM and InnoDB can be backed up, but the backup MyISAM needs to be read locked.

# install the percona-xtrabackup rpm package.

[root@localhost data] # rpm-ivh percona-xtrabackup-2.3.2-1.el6.x86_64.rpm warning: percona-xtrabackup-2.3.2-1.el6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID cd2efd2a: NOKEYerror: Failed dependencies:libev.so.4 () (64bit) is needed by percona-xtrabackup-2.3.2-1.el6.x86_64perl (DBD::mysql) is needed by percona-xtrabackup-2.3.2-1.el6.x86_64

# installation dependency:

Yum install perl-DBD-MySQL

# install libev package

Go to http://rpmfind.net/linux/rpm2html/search.php?query=libev.so.4%28%29%2864bit%29&submit=Search+...&system=&arch= to download the libev package corresponding to the operating system, and pay attention to the system number and version digits

[root@master] # wget ftp://rpmfind.net/linux/dag/redhat/el6/en/x86_64/dag/RPMS/libev-4.15-1.el6.rf.x86_64.rpm-- 2016-05-17 12-12 wget 54-43-ftp://rpmfind.net/linux/dag/redhat/el6/en/x86_64/dag/RPMS/libev-4.15-1.el6.rf.x86_64.rpm-ftp://rpmfind.net/linux/dag/redhat/el6/en/x86_64/dag/RPMS/libev-4.15-1.el6.rf.x86_64.rpm = > "libev- 4.15-1.el6.rf.x86_64.rpm "Resolving rpmfind.net... 195.220.108.108 Connecting to rpmfind.net | 195.220.108.108 |: 21. Connected. Logging in as anonymous... Logged in! = > SYST... Done. = > PWD... Done. = > TYPE I... Done. = > CWD (1) / linux/dag/redhat/el6/en/x86_64/dag/RPMS... Done. = > SIZE libev-4.15-1.el6.rf.x86_64.rpm... 74692 = > PASV... Done. RETR libev-4.15-1.el6.rf.x86_64.rpm... Done. Length: 74692 (73K) (unauthoritative) 100% [= >] 74692 187K/s in 0.4s 2016-05-17 12:54:46 (187KB/s)-"libev-4.15-1.el6.rf.x86_64.rpm" saved [74692]

Install the libev-4.15-1.el6.rf.x8664.rpm package for RHEL6

[root@master] # rpm-ivh libev-4.15-1.el6.rf.x86_64.rpm warning: libev-4.15-1.el6.rf.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 6b8d79e6: NOKEY Preparing... # [100%] 1:libev #

# install percona-xtrabackup package:

[root@localhost data] # rpm-ivh percona-xtrabackup-2.3.2-1.el6.x86_64.rpm warning: percona-xtrabackup-2.3.2-1.el6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID cd2efd2a: NOKEYPreparing... # [100%] percona-xtrabackup #

The operation process is shown in the figure:

Tags: Backup data increment directory file user tool time version transaction memory parameter password time system service configuration data recovery different operating system Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Xiaomi Microsoft NVidia Shulou Technology