Open source MySQL Hot Backup tool xtrabackup Detailed learning manual

Source: Internet
Author: User
Tags manual mysql mysql backup mysql database perl script backup

1.Xtrabackup Tools Introduction:

Xtrabackup is a tool for data backup of InnoDB, which supports online hot backup (without affecting data reading and writing during backup), is a good substitute for the commercial Backup tool InnoDB Hotbackup.

Xtrabackup has two main tools: Xtrabackup and Innobackupex

Xtrabackup can only back up InnoDB and xtradb two types of datasheets, not backup MyISAM data tables

Innobackupex is a reference to InnoDB Hotbackup's innoback script modifications, Innobackupex is a Perl script encapsulation that encapsulates xtrabackup. The main purpose is to backup the InnoDB and MyISAM engine tables at the same time, but a read lock is required to handle the MyISAM. and added some options to use.

2.Xtrabackup Installation:

The simplest is the PRM package, which is installed using the binary package method below

1. Unpack the Package

[Root@nagios opt]# TAR-ZXVF xtrabackup-1.6.3.tar.gz

2. Move the unpacked package to the/usr/local/directory and rename it to Xtrabackup

[Root@nagios opt]# MV Xtrabackup-1.6.3/usr/local/xtrabackup

3. Modifying environment variables

[Root@nagios opt]# export path= $PATH:/usr/local/xtrabackup/bin

The following error occurred while backing up the database

[Root@nagios bin]# pwd

/usr/local/xtrabackup/bin

[Root@nagios bin]#/innobackupex-1.5.1--port=3306--tmpdir= '/tmp/mysql '--defaults-file= '/etc/my.cnf '--database= ' Firstdb '--user= ' root '--password= ' MySQL '/root/db_backups

innobackupex-1.5.1:: warning:ignored Unrecognized line 2 in options: ' xtrabackup:Error:Please set parameter ' DataDir '

Innobackupex-1.5.1:fatal error:no ' mysqld ' Group in MySQL options

Innobackupex-1.5.1:fatal error:or No ' datadir ' option in the group ' mysqld ' in MySQL options

Add or modify the database storage directory in the database configuration file:

[Root@nagios bin]# cat/etc/my.cnf |grep datadir

DataDir =/usr/local/mysql/data

3.Xtrabackup Full BACKUP Database

./innobackupex-1.5.1

Directory of--ibbackup= '/usr/local/xtrabackup/bin/xtrabackup ' */xtrabackup files

--port=3306 */mysql Database Port

--tmpdir= '/tmp/mysql ' */mysql database mysql.sock file storage directory

--defaults-file= '/etc/my.cnf ' */mysql database configuration file

--database= ' firstdb '/backup MySQL database, you can back up multiple databases, each database separated by a space, with double quotes

--user= ' root ' */mysql database username

password= ' mysql ' */mysql database password

/root/db_backups */mysql backup Data storage directory

Full Backup and Package

./innobackupex-1.5.1--port=3306--tmpdir= '/tmp/mysql '--defaults-file= '/etc/my.cnf '--database= ' the Firstdb '--user= ' Root '--password= ' mysql '--stream=tar/root/db_backups |gzip/root/db_backups/*.*.tar.gz

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.