Percona Xtrabackup 8.0 backup MySQL8.0

With the introduction of Percona XtraBackup 8.0, Percona XtraBackup 2.4 will continue to support MySQL and Percona Server 5.6 and 5.7 databases.


Because MySQL 8.0 in the data dictionary, redo logs and undo the change log is not compatible with previous versions introduced, so Percona XtraBackup 8.0 is not currently supported versions prior to 8.0.


Percona compression mode need to install self-development qpress compression tool.

# yum install  https://repo.percona.com/yum/percona-release-latest.noarch.rpm  
# yum install qpress -y


1, backup

# xtrabackup --defaults-file=/etc/my_hechunyang.cnf -S /tmp/mysql_hechunyang.sock 
--user='root' --password='123456' --slave-info --backup 
--compress --compress-threads=4 --target-dir=/data/bak/

Note: - slave-info parameter is recorded from the POS point library show slave status, the position information recorded in the file / data / bak / xtrabackup_slave_info years.

      --compress compression mode is turned on

      --compress-threads is the number of open compressed mode thread


2, unzip

# for bf in `find . -iname "*\.qp"`; do qpress -d $bf $(dirname $bf) && rm -f $bf; done


3, restore the incremental data (this step is similar innobackupex --apply-log) during backup

# xtrabackup  --prepare --target-dir=/data/bak/


4, recovery
1, close the mysqld process
2, to ensure datadir directory is empty, you can change the original directory name, then create a new
3 recovery

# xtrabackup --defaults-file=/etc/my_hechunyang.cnf --copy-back --target-dir=/data/bak/

4. Change the directory properties

# chown -R mysql:mysql /var/lib/mysql/

5, start mysqld process



Guess you like

Origin blog.51cto.com/hcymysql/2456461