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

MySQL Xtrabackup backup and recovery method

2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article focuses on "MySQL Xtrabackup backup and recovery methods". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "MySQL Xtrabackup backup and recovery method".

Xtrabackup is a data backup tool for InnoDB, supports online hot backup (backup does not affect data read and write), and is a good substitute for commercial backup tool InnoDB Hotbackup. Xtrabackup has two main tools: xtrabackup and innobackupex, in which xtrabackup can only back up InnoDB and XtraDB data tables, while innobackupex encapsulates xtrabackup and can back up MyISAM data tables at the same time.

1. Install mysql

two。 Install Xtrabackup, Xtrabackup

Configure sourc

# vi / etc/yum.repos.d/percona.repo

Java code

[percona]

Name = CentOS $releasever-Percona

Baseurl= http://repo.percona.com/centos/$releasever/os/$basearch/

Enabled = 1

Gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-percona

Gpgcheck = 1

Add key

# cd / etc/pki/rpm-gpg

# wget http://www.percona.com/downloads/RPM-GPG-KEY-percona

Install Xtrabackup

Yum install xtrabackup

3 backup

# xtrabackup-backup-datadir=/var/lib//-target-dir=/data/backups/mysql/

4 restore backup data

a. Stop the MySQL service: $/ etc/init.d/mysqld stop or service mysql stop

b. Modify the datadir of my.cnf to the backup directory: datadir=/data/backups/mysql/

c. Start the MySQL service: $/ etc/init.d/mysqld start the latter service mysql start

It's quite simple. As for incremental backups, you must specify the directory of the last backup at the time of backup.

Xtrabackup-backup-target-dir=/data/backups/inc1-incremental-basedir=/data/backups/base-datadir=/var/lib/mysql/

At this point, I believe you have a deeper understanding of the "MySQL Xtrabackup backup and recovery method". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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