Using innobackupex to back up a single MySQL database

Source: Internet
Author: User
Tags percona

Using innobackupex to back up a single MySQL database

Purpose

Using innobackupex to back up a single MySQL database

Environment

OS: CentOS 6.6 32bit

Introduction

Official Website: https://www.percona.com/

Https://www.percona.com/downloads/XtraBackup/LATEST/

Operation

# Start backup
Innobackupex -- password = RedHat -- databases = db1/backup/
# Note: redhat is the root password of MySQL, db1 is the database I want to back up, And/backup/is the directory where my backups are stored (create a backup first ).
 
# Simulated recovery
# Stop a service
Service mysqld stop
# Clear the data directory (Note:/wwwroot/mysql/is my data directory)
Rm-rf/wwwroot/mysql /*
# Entering the prepare stage
Innobackupex -- apply-log/backup/2015-11-07_15-12-34/
# Entering the recovery phase
Innobackupex -- copy-back/backup/2015-11-07_15-12-34/
# Initializing a database through mysql_install_db
Cd/usr/local/webserver/mysql/
./Scripts/mysql_install_db -- user = mysql -- datadir =/wwwroot/mysql/
# Authorization
Chown-R mysql: mysql/wwwroot/mysql/
# Start the service
Service mysqld start
# Initialize the root password (Note: redhat is my password)
Mysqladmin-uroot password redhat

The above steps can be used to back up a single database, but I think it is useless. because we still need to back up the shared data source, that file is the largest, so it is better to back up the entire file directly.

XtraBackup and InnoBackupex online backup

This article permanently updates the link address:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.