Using innobackupex to implement full MySQL Hot Backup

Source: Internet
Author: User
Tags percona

Using innobackupex to implement full MySQL Hot Backup

Purpose

Using innobackupex to implement full MySQL Hot Backup

Environment

OS: CentOS 6.6 32bit

Introduction

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

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


Operation
# Create a directory for storing backups
Mkdir/backup

# Start backup. Make sure there is sufficient space before backup.
Innobackupex -- password = RedHat/backup/
# This is the simplest use of this command, Because I directly use root user backup, so the -- user parameter is omitted.
# Note: The password entered here is the MySQL administrator password. Do not make a mistake.
# If you are not using the root user for backup, you need to specify the -- user parameter.
# If your database configuration file is not the default/etc/my. cnf file, you need to use the -- defaults-file parameter to specify it.
# By default, the system will automatically create a directory named after the current time in the backup directory you specified. If you want to name it in your own style, you can use the -- no-timesmtap parameter. The parameter may appear in other chapters in the future.
# Note: it is best to visit my. specify datadir In the cnf file. Otherwise, you may need to use the -- datadir parameter when using this command for backup. The same is true for recovery. Therefore, it is best to directly use datadir in my. cnf.

# After the backup is complete, verify the effect (do not test the production environment for beginners ).
# Stop the database first
Service mysqld stop
# Clear the data directory (my data directory is/wwwroot/mysql). Be sure not to delete the parent directory mysql.
Rm-rf/wwwroot/mysql /*
# Enter the prepare stage. Note that you must select the timestamp directory you just backed up.
Innobackupex -- apply-log/backup/2015-11-07_14-08-51/
# Entering the recovery phase
Innobackupex -- copy-back/backup/2015-11-07_14-08-51/
# Authorization
Chown-R mysql: mysql/wwwroot/mysql/
# Start the service
Service mysqld start

After performing the preceding operations, a complete backup and restoration are completed.

Note: The data directory must be cleared during full restoration; otherwise, the restoration result may be affected.

XtraBackup and InnoBackupex online backup

Using innobackupex to back up a single MySQL database

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.