Mysqlbackup (MySQL official Backup Tool)

Source: Internet
Author: User

A.1Full database backup.

Command:

Mysqlbackup-- Defaults-file =/home/mysql-server/mysql3/my. cnf -- user = root -- password = root -- databases = "mysql total2" -- with-timestamp -- backup-dir =/home/mysql-server/backup

Parameter description:

-- Defaults-fileMy. cnfFile Path,It is mainly used for multiple servers.MysqlService.The default position is/Etc/my. cnf

-- UserUser Name,This user must beMysqlThe library has been created.TableAnd Query,Insert permission.During the backup process. MysqlbackupTheMysqlCreate under libraryBackup_history, backup_progressTable.The user retains historical backup information and basic backup information..

-- PasswordPassword

-- DatabaseDatabase to be backed up,To back up multiple databases, you must use""Include,Separate each database with spaces

-- With-timestampThe user creates a folder at the current time under the Backup Directory,If you do not have this parameter,Multiple backups,Create the same directory,Overwrites the last backup file..

-- Backup-dirBackup Directory

BackupIndicates,This is a backup operation.

A.2Full database Restoration.

Step 1:Transaction Log Detection

Mysqlbackup -- defaults-file =/home/mysql-server/mysql2/my. cnf-- Backup-dir =/home/mysql-server/backup/2012-03-21_14-01-34/apply-log

Parameter description:

Apply-log:Because it is online during Backup,If a newly insertedSQLStatement,Will record the newly addedLSNPoint,Then the newly modified page will be placed in this file (Ibbackup_logfile),It will also be placed in the tablespace..When this parameter is used for restoration, MysqlbackupWill detectIbbackup_logfileAnd tablespaceLSNPoint,Then compareIbbackup_logfileFile tablespaceLSNDifference,Put this value in the transaction logLOGInside.(If the transaction log is full,Will enter the tablespace)

Step 2: CopyPhysical files

Mysqlbackup -- defaults-file =/home/mysql-server/mysql2/my. cnf-- Backup-dir =/home/mysql-server/backup/2012-03-21_14-01-34/-- innodb_log_files_in_group = 2 copy-back

 

B .1Compressing full-Database Backup

Mysqlbackup-- Defaults-file =/home/mysql-server/mysql3/my. cnf -- user = root -- password = root -- compress-level = 1 -- databases = "mysql total2" -- with-timestamp -- backup-dir =/home/mysql-server/backup

 

Parameter description:

-- Compress-level = 1

1For quick Compression.Total9Levels

B .2Compression and Restoration

Step 1:Transaction Log Detection,Decompress the package

Mysqlbackup -- defaults-file =/home/mysql-server/mysql2/my. cnf -- uncompress -- backup-dir =/home/mysql-server/backup/2012-03-21_14-08-33/apply-log

UncompressDecompress the compressed file.

Step 2: CopyPhysical files

Mysqlbackup -- defaults-file =/home/mysql-server/mysql2/my. cnf -- innodb_log_files_in_group = 2 -- backup-dir =/home/mysql-server/backup/2012-03-21_14-08-33/Copy-back

Incremental backup does not support Compression. Backup-and-apply-logParameters cannot match-- Compress-levelSame purpose

  • 1
  • 2
  • 3
  • Next Page

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.