Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

XtraBackup backup restore MySQL 5.6database

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Download XtraBackup:

# wget https://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-2.4.6/binary/tarball/percona-xtrabackup-2.4.6-Linux-x86_64.tar.gz

Decompression software:

# tar xvf percona-xtrabackup-2.4.6-Linux-x86_64.tar.gz-C / usr/local/

# cd / usr/local/

# mv percona-xtrabackup-2.4.6-Linux-x86_64/ xtrabackup

Set the environment variable:

# echo "export PATH=/usr/local/xtrabackup/bin:\ $PATH" > > / etc/profile

# source / etc/profile

Install the dependency package:

Yum install-y perl-Digest-MD5

Full database:

[mysql@publicserver] $innobackupex-- defaults-file=/etc/my.cnf-- user=root-- password=centos-- socket=/var/lib/mysql/mysql.sock / mysqlbk

Incremental backup database:

[mysql@publicserver] $innobackupex-- defaults-file=/etc/my.cnf-- user=root-- password=centos-- socket=/var/lib/mysql/mysql.sock-- incremental--incremental-basedir=/mysqlbk/2017-03-26mm 21-56-46 / mysqlbk_rec

Full recovery preparation:

[mysql@publicserver] $innobackupex-- defautls-file=/mysqlbk/my.cnf-- apply-log-- redo-only / mysqlbk/2017-03-26mm 21-56-46

Incremental recovery preparation:

[mysql@publicserver] $innobackupex-- defaults-fil=/mysqlbk/my.cnf-- apply-log / mysqlbk/2017-03-26,21-56-46-- incremental-dir=/mysqlbk_rec/2017-03-26,21-57-11

Execute innobackupex-- apply-log:

[mysql@publicserver] $innobackupex-- defautls-file=/mysqlbk/my.cnf-- apply-log / mysqlbk/2017-03-26mm 21-56-46

Perform a restore:

[mysql@publicserver] $innobackupex-- defaults-file=/mysqlbk/my.cnf-- socket=/var/lib/mysql/mysql.sock-- copy-back / mysqlbk/2017-03-26mm 21-56-46

Compress the backup set:

[mysql@publicserver ~] $innobackupex-- defaults-file=/usr/local/mysql/my.cnf-- user=root-- password=centos-- socket=/tmp/mysql.sock-- stream=tar / tmp | gzip-> / mysqlbk/mysql_fullbackup.tar.gz

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report