Percona-XtraBackup:How To Install And Configuration Percona-XtraBackup And Taking backup and restore for mysql Instance
Percona-XtraBackup:How To Install And Configuration Percona-XtraBackup /Restore And Taking backup for mysql Instance 8.0.0.
Percona XtraBackup:
A free, open-source tool that creates physical backups of InnoDB, XtraDB, and MyISAM tables. It supports incremental backups, compression, and encryption.
XtraBackup is an open-source hot backup utility for MySQL-based database provided by percona. According their official documents, XtraBackup is the world's only open-source, free MySQL hot backup software that perform non-blocking backups for InnoDB and XtraDB database.
Step.1.We are going to percona website and download rpm package for mysql 8.0.0.
https://www.percona.com/downloads
Note:-Suppose that if you are using mysql 5.7 than so pls use percona Xtrabackup 2.x.x and you are using mysql 8.x.x than pls using percona Xtrabackup 8.x.x.
Step.2.Now we are finally download the percona Xtrabackup tar file.
step.3.Now we are going to percona Xtrabackup untar file, Given below command:-
tar -xvf Percona-XtraBackup-8.0.35-31-r55ec21d7-el8-x86_64-bundle.tar
After untar file ,We are getting four rpm file but only is a right file for installation percona Xtrabackup.
step.4.Now we are going to install percona Xtrabackup RPM package,Given below command
Two dependency file are needed for percona-xtrabackup mention in snap short,so first we need to resolved dependency first.
Finally we have successfully resolved dependency and install percona-xtrabackup.
step.5. Now we have check percona-xtrabackup version .using given below command
xtrabackup --version
And also pls check --help
step.6.Now are going to create directory for backup stroages.
Step.7.Now we are going to take full backup in mysql 8.x.x and using Percona-XtraBackup utility.
Given below command:-
xtrabackup --backup --user=db_user --password --target-dir=/data/backups
Pls enter password for continue backup:-
Finally backup is done and backup file is listed on given below directory:-
Now we are going to restore full backup:-
step.8.Now first of all we are going run below command for prepare backup
xtrabackup --prepare --target-dir=/data/backups
step.9.Now we are going to rename mysql data dir and we have run command and no mysql directory found.
step.10.stop mysql service.
systemctl stop mysqld
step.11.Now we are going restore finally full database backup using given below command:-
xtrabackup --copy-back --target-dir=/data/backups
Finally we have successfully restore database.
step.11.Data file is avilabe given below directory
cd /varlib/mysql
step.12.Now we are going to change user and group for mysql data directory /var/lib/mysql
chown -R mysql:mysql /var/lib/mysql
You can see after and before in screen shot.
step.13. Now we are going to start mysql service.
systemctl start mysqld
step.14.Now we are able to login mysql
Comments
Post a Comment