Backup of mysql very large database
Xtrabackup tool is a data backup tool for InnoDB, which supports full bright backup and incremental backup. Backup of MyISAM databases is not supported, but Xtrabackup has a tool called innobackupex, which supports MyISAM, but requires flush tables with read lock read locks and unlock tables read locks when backing up. To use innobackupex backup, you first need to specify datadirinnodb_log_file_size = 5m such as: datadir=/usr/local/mysql2 in [mysqld] in my.cnf. The whole database backup innobackupex-- defaults-file=/etc/my.cnf-- user=root / home/backup3. Backup innobackupex-- defaults-file=/etc/my.cnf-- user=root-- database=backup_test / home/backup4 for a single database. Back up and compress innobackupex-- defaults-file=/etc/my.cnf-- user=root-- stream=tar | gzip > / home/backup/ `date +% FMI% T`.tar.gz5. Whole data restore 1) stop mysql/etc/init.d/mysqld stop2) backup data directory mv / usr/local/mysql / usr/local/mysql.bak3) recreate the directory mkdir-p / usr/local/mysql4) change the file ownership chown mysql:mysql / usr/local/mysql5) backup data 2 steps innobackupex-- defaults-file=/etc/my.cnf-- user=root-- apply-log / home/backup/2015-11-29016-50-36innobackupex-- defaults-file=/etc/my.cnf-- copy-back / home/backup/2015-11-29016-50-366.There are two steps in this paper. Incremental backup is an operation based on the previous full backup. Innobackupex-- defaults-file=/etc/my.cnf-- user=root-- incremental-basedir=/home/backup/2015-11-29016-50-36-- incremental / home/backup7. View the backup record file cat xtrabackup_checkpoints backup_type = full-preparedfrom_lsn = 0last_lsn = 22223450compact = 0.8. Incremental backup and restore innobackupex-- defaults-file=/etc/my.cnf-- user=root-- apply-log-- redo-only / home/backup/2015-11-294th 16-50-36 innobackupex-- defaults-file=/etc/my.cnf-- user=root-- apply-log-- redo-only / home/backup/2015-11-29th 16-55-49-- incremental-dir=/home/backp/2015-11-29th 14-30-37innobackupex-- defaults-file=/my.cnf-- User=root-- apply-log / data/backup/2015-11-29 16-50-36 then step 5 to one side. References http://blog.51yip.com/mysql/1650.html http://www.cnblogs.com/gomysql/p/3650645.html