--1. Fully prepared ****************************************** #mysqlbackup--defaults-file=/usr/local/mysql/my.cnf--host=127.0.0.1--port=3306--protocol= TCP--user=root--password=passwd123! --databases= "Wind"--with-timestamp--backup-dir=/backup--log-bin-index=/usr/local/mysql/mysql_logs/binary_log/ Mysqldb01-bin.index backup-and-apply-log----NOTE:mysqlbackup:INFO:Could not find Binlog index file. Binlogs is not being copied for this backup. Point-in-time-recovery is not being possible. If This was online backup then server may not be started with--log-bin. Specify it location with--LOG-BIN-INDEX option. #cat/backup/2015-04-01_09-39-09/meta/backup_variables.txt |GR EP ' LSN ' end_lsn=70249846start_lsn=70249472/*************************** parameter [Backup_variables]apply_log_done=1 # Whether to release the instrumented Ibbackup_logfile file (0 means no, 1 indicates already released) Binlog_index=mysqldb01-bin.index #二进制日志索引文件binlog_position = mysqldb01-bin.000011:338 #二进制日志文件大小end_lsn = 70249846 # end LSN Point has_external_plugins=0 #外部插件is_compressed =0 #是否压缩 (0: No, 1: Yes) Is_incrementa L=0 #是否是增量为增量备份文件 (0: No, 1: YES) is_incremental_with_redo_log_only=0 only configures the redo log, when the input data size redo log size, there will be a throw is_onlyinnodb=0 # Whether to back up only the InnoDB table Is_partial=1 #是服务器备份还是部分备份 (0 for full server backup, 1 for partial backup) is_skip_unused_pages=0 meb_version=3.12.0 #版本号start_ lsn=70249472 #开始备份的LSN点 ***************************/************************************************************ * *---2. Incremental backup **************************************************************mysqlbackup--defaults-file=/usr/local /MYSQL/MY.CNF--host=127.0.0.1--port=3306--protocol=tcp--user=root--password=passwd123! --databases= "Wind"--with-timestamp--log-bin-index=/usr/local/mysql/mysql_logs/binary_log/mysqldb01-bin.index-- Incremental--start-lsn=70249846--incremental-backup-dir=/backupinc backup Mysqlbackup--defaults-file=/usr/local/ MYSQL/MY.CNF--host=127.0.0.1--port=3306--protocol=tcp--user=root--password=passwd123! --databases= "Wind"--with-timestamp--log-bin-index=/usr/local/mysql/mysql_logs/binary_log/mysqldb01-bin.index-- Incremental--start-lsn=138861169--incremental-backup-dir=/backupinc Backup ************************************* --3. Restoring a specified tablespace **************************************************************--3.1 Consolidate incremental backups to fully prepared ls/backupinc/2015-04-01_10-03-16 2015-04-01_10-11-51mysqlbackup--backup-dir=/backup/2015-04-01_ 09-39-09--incremental-backup-dir=/backupinc/2015-04-01_10-03-16 apply-incremental-backup mysqlbackup--backup-dir =/backup/2015-04-01_09-39-09--incremental-backup-dir=/backupinc/2015-04-01_10-11-51 Apply-incremental-backup-- 3.2 Simulation Delete specified tablespace #cat/usr/local/mysql/my.cnf |grep datadirdatadir=/usr/local/mysql/datamariadb [(none)]> Show databases;+--------------------+| Database |+--------------------+| Information_schema | | Jason | | MySQL | | Performance_schema | | Test | | Wind |+--------------------+6 rows in Set (0.01 sec) MariaDB [wind]> Select COUNT (*) from t1;+----------+| COUNT (*) |+----------+| 3000000 |+----------+1 row in Set (0.60 sec) MariaDB [(None)]> drop database wind; Query OK, 1 row affected (0.24 sec) MariaDB [(none)]> commit; Query OK, 0 rows Affected (0.00 sec) MariaDB [(None)]> show databases;+--------------------+| Database |+--------------------+| Information_schema | | Jason | | MySQL | | Performance_schema | | Test |+--------------------+5 rows in Set (0.00 sec)--3.3 Restore specified tablespace mysqlbackup--defaults-file=/usr/local/mys QL/MY.CNF--datadir=/usr/local/mysql/data/--log-bin-index=/usr/local/mysql/mysql_logs/binary_log/ Mysqldb01-bin.index--backup-dir=/backup/2015-04-01_09-39-09--databases= "Wind" Copy-back chown-r mysql/usr/local/ Mysqlchgrp-r mysql/usr/local/mysql--3.4 Verifying table space recovery mariadb [(none)]> show databases;+--------------------+| Database |+--------------------+| Information_schEMA | | Jason | | MySQL | | Performance_schema | | Test | | Wind |+--------------------+6 rows in Set (0.01 sec) MariaDB [wind]> Select COUNT (*) from t1;+----------+| COUNT (*) |+----------+| 3000000 |+----------+1 row in Set (0.60 sec)
MySQL Enterprise backup Getting started with