Full hot backup of MySQL with Innobackupex

Source: Internet
Author: User

Statement

The Stars last night

Blog:http://yestreenstars.blog.51cto.com/

This article by oneself creation, if need reprint, please indicate source, thank cooperation!

Objective

Full hot backup of MySQL with Innobackupex

Environment

Os:centos 6.6 32bit

Introduced

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

Official: https://www.percona.com/downloads/XtraBackup/LATEST/

Operation

#  create a directory to hold the backup mkdir /backup#  start the backup, make sure you have enough space before backing up. innobackupex --password=redhat /backup/#  This is the simplest use of this command, because I am backing up directly with the root user, so I omit the--user parameter. #  Note that the password entered here is the MySQL administrator password, do not mistake oh. #  If you are not using the root user to back up, you will need to specify the--user parameter. #  If your database configuration file is not the default/ETC/MY.CNF, then you need to specify it with the--defaults-file parameter. #  by default, the system automatically creates a directory named after the current time stamp in the backup directory you specify, and if you want to name it in your own style, you can use the--no-timesmtap parameter, which may later appear in other chapters for this parameter. #  Note that it is a good idea to specify DataDir in the my.cnf file, otherwise you might need to use the--datadir parameter when you use the command backup, so it is best to specify it directly in MY.CNF. #  after the backup is of course to verify the effect (beginners do not take the production environment to test OH). #  Stop the database service mysqld stop#  empty the data directory (my Data directory is/wwwroot/mysql), be careful not to delete the parent directory MySQL. rm -rf /wwwroot/mysql/*#  into the prepare phase, note that you must select the time stamp directory you just backed up. innobackupex --apply-log /backup/2015-11-07_14-08-51/#  into recovery phase Innobackupex --copy-back  /backup/2015-11-07_14-08-51/#  Authorized chown -r mysql:mysql /wwwroot/mysql/#  Start Service Service mysqld start 

A full backup and restore is completed with the above operation.

Note that you must clear the data directory when you do a full restore, otherwise it will affect the result of the restore.

This article is from the "Last Night Stars" blog, please make sure to keep this source http://yestreenstars.blog.51cto.com/1836303/1710586

Full hot backup of MySQL with Innobackupex

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.