XtraBackup全备与增量备份

一、XtraBackup安装

下载地址:http://www.percona.com/downloads/XtraBackup/XtraBackup-2.2.8/source/

安装步骤:

================================
How to build XtraBackup on Linux
================================Prerequisites
-------------
$ yum install cmake gcc gcc-c++ libaio libaio-devel automake autoconf bzr bison libtool ncurses5-develCompiling with CMake -------------------- $ cmake -DBUILD_CONFIG=xtrabackup_release && make -j4
Installation ------------ $ make install

  will install all XtraBackup binaries, the innobackupex script and tests to /usr/local/xtrabackup. You can override this either with “make DESTDIR=... install” or by changing the installation layout with “cmake -DINSTALL_LAYOUT=...”.

 

如果出现下面报错,需要 yum install crypt* ; yum install libgcrypt*

CMake Error at cmake/gcrypt.cmake:25 (MESSAGE):Cannot find gcrypt.h in /usr/include;/usr/local/include;/opt/local/include.You can use libgcrypt-config --cflags to get the necessary path and pass itto CMake with -DGCRYPT_INCLUDE_PATH=<path>
Call Stack (most recent call first):storage/innobase/xtrabackup/src/CMakeLists.txt:20 (FIND_GCRYPT)CMake Error at cmake/gcrypt.cmake:36 (MESSAGE):Cannot find libgcrypt shared libraries in/usr/lib;/usr/local/lib;/opt/local/lib.  You can use libgcrypt-config--libs to get the necessary path and pass it to CMake with-DGCRYPT_LIB_PATH=<path>
Call Stack (most recent call first):storage/innobase/xtrabackup/src/CMakeLists.txt:20 (FIND_GCRYPT)

 

二、xtrabackup全备测试

普通备份(全量备份)
[root@server mysql]# mkdir /data/mysql/databak
[root@server mysql]# xtrabackup --defaults-file=/usr/local/mysql/my.cnf --backup --target-dir=/data/mysql/databak/
[root@server mysql]# cp -rp data/test/students.frm databak/test/
注意:xtrabackup只备份数据文件,并不备份数据表结构(.frm),所以这里要手动备份一下,以便xtrabackup恢复的时候使用,如果是做了分表分文件保存的话,就需要挑出.frm表结构,表数据文件.ibd不需要复制

全量备份恢复
实施对备份文件进行恢复前的准备
[root@server mysql]# xtrabackup --defaults-file=/usr/local/mysql/my.cnf --prepare --target-dir=/data/mysql/databak/
从备份目录复制对应数据库表结构到默认的数据目录[如果是做了分表分文件,则需要全部复制到默认的数据目录]
cp -r /data/mysql/databak/test /data/mysql/data/
删除默认数据目录中对应的数据文件并复制备份的数据文件到默认数据目录
rm /data/mysql/data/ib*
cp /data/mysql/databak/ib* /data/mysql/data/
修改数据目录权限[注意细节:mysql库的所有者是mysql,组是root]
chown -R mysql:mysql /data/mysql/data
重启MySQL
[root@server data]# /etc/init.d/mysqld restart

三、xtrabackup增量备份测试

1. 全备
[root@server databak]# mkdir /data/mysql/databak/
[root@server mysql]# xtrabackup --defaults-file=/usr/local/mysql/my.cnf --backup --target-dir=/data/mysql/databak/
[root@server mysql]# cp -rp data/test/students.frm databak/test/
2. 增量备份
[root@server databak]# mkdir /data/mysql/databak/delta/
[root@server databak]# xtrabackup --defaults-file=/usr/local/mysql/my.cnf --backup --incremental-basedir=/data/mysql/databak/ --target-dir=/data/mysql/databak/delta/

3. 备份恢复准备[这里没有完成增量备份,增量备份数据恢复失败]

[root@server data]# xtrabackup --defaults-file=/usr/local/mysql/my.cnf --prepare --target-dir=/data/mysql/databak/
[root@server data]# xtrabackup --defaults-file=/usr/local/mysql/my.cnf --prepare --target-dir=/data/mysql/databak/ --incremental-dir/=/data/mysql/databak/delta/

4. 恢复数据库

从备份目录复制对应数据库表结构到默认的数据目录[如果是做了分表分文件,则需要全部复制到默认的数据目录]
cp -r /data/mysql/databak/test /data/mysql/data/
删除默认数据目录中对应的数据文件并复制备份的数据文件到默认数据目录
rm /data/mysql/data/ib*
cp /data/mysql/databak/ib* /data/mysql/data/
修改数据目录权限[注意细节:mysql库的所有者是mysql,组是root]
chown -R mysql:mysql /data/mysql/data

四、用innobackupex 执行全备与增量备份

innobackupex全备和增量备份
1. 全备

[root@server mysql]# innobackupex --user=root --password=redhat /data/mysql/databak/
innobackupex: got a fatal error with the following stacktrace: at /usr/bin/innobackupex line 3637
main::init() called at /usr/bin/innobackupex line 1557
innobackupex: Error: option 'datadir' has different values:
'/var/lib/mysql' in defaults file
'/data/mysql/data/' in SHOW VARIABLES

 

执行失败,需要指定配置文件路径:

[root@server xtrabackup]# innobackupex --defaults-file=/usr/local/mysql/my.cnf --user=root --password=redhat /data/mysql/databak/InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona LLC and/or its affiliates 2009-2013.  All Rights Reserved.This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.150204 19:00:03  innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_file=/usr/local/mysql/my.cnf;mysql_read_default_group=xtrabackup' as 'root'  (using password: YES).
150204 19:00:03  innobackupex: Connected to MySQL server
150204 19:00:03  innobackupex: Executing a version check against the server...
150204 19:00:03  innobackupex: Done.
150204 19:00:03  innobackupex: Starting the backup operationIMPORTANT: Please check that the backup run completes successfully.At the end of a successful backup run innobackupexprints "completed OK!".innobackupex:  Using server version 5.5.30innobackupex: Created backup directory /data/mysql/databak/2015-02-04_19-00-03150204 19:00:03  innobackupex: Starting ibbackup with command: xtrabackup  --defaults-file="/usr/local/mysql/my.cnf"  --defaults-group="mysqld" --backup --suspend-at-end --target-dir=/data/mysql/databak/2015-02-04_19-00-03 --tmpdir=/tmp --extra-lsndir='/tmp'
innobackupex: Waiting for ibbackup (pid=19209) to suspend
innobackupex: Suspend file '/data/mysql/databak/2015-02-04_19-00-03/xtrabackup_suspended_2'xtrabackup version 2.2.8 based on MySQL server 5.6.22 Linux (x86_64) (revision id: )
xtrabackup: uses posix_fadvise().
xtrabackup: cd to /data/mysql/data/
xtrabackup: open files limit requested 0, set to 1024
xtrabackup: using the following InnoDB configuration:
xtrabackup:   innodb_data_home_dir = /data/mysql/data
xtrabackup:   innodb_data_file_path = ibdata1:1G:autoextend
xtrabackup:   innodb_log_group_home_dir = ./
xtrabackup:   innodb_log_files_in_group = 2
xtrabackup:   innodb_log_file_size = 5242880
xtrabackup: using O_DIRECT
>> log scanned up to (1602080)
xtrabackup: Generating a list of tablespaces
[01] Copying /data/mysql/data/ibdata1 to /data/mysql/databak/2015-02-04_19-00-03/ibdata1
>> log scanned up to (1602080)
>> log scanned up to (1602080)
>> log scanned up to (1602080)
>> log scanned up to (1602080)
>> log scanned up to (1602080)
>> log scanned up to (1602080)
>> log scanned up to (1602080)
>> log scanned up to (1602080)
>> log scanned up to (1602080)
>> log scanned up to (1602080)
>> log scanned up to (1602080)
[01]        ...done
>> log scanned up to (1602080)
[01] Copying ./test/students.ibd to /data/mysql/databak/2015-02-04_19-00-03/test/students.ibd
[01]        ...done
>> log scanned up to (1602080)
xtrabackup: Creating suspend file '/data/mysql/databak/2015-02-04_19-00-03/xtrabackup_suspended_2' with pid '19209'150204 19:00:17  innobackupex: Continuing after ibbackup has suspended
150204 19:00:17  innobackupex: Executing FLUSH TABLES WITH READ LOCK...
150204 19:00:17  innobackupex: All tables locked and flushed to disk150204 19:00:17  innobackupex: Starting to backup non-InnoDB tables and files
innobackupex: in subdirectories of '/data/mysql/data/'
innobackupex: Backing up files '/data/mysql/data//performance_schema/*.{frm,isl,MYD,MYI,MAD,MAI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}' (18 files)
>> log scanned up to (1602080)
innobackupex: Backing up file '/data/mysql/data//test/students.frm'
innobackupex: Backing up files '/data/mysql/data//mysql/*.{frm,isl,MYD,MYI,MAD,MAI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}' (72 files)
150204 19:00:17  innobackupex: Finished backing up non-InnoDB tables and files150204 19:00:17  innobackupex: Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS...
150204 19:00:17  innobackupex: Waiting for log copying to finishxtrabackup: The latest check point (for incremental): '1602080'
xtrabackup: Stopping log copying thread.
.>> log scanned up to (1602080)xtrabackup: Creating suspend file '/data/mysql/databak/2015-02-04_19-00-03/xtrabackup_log_copied' with pid '19209'
xtrabackup: Transaction log of lsn (1602080) to (1602080) was copied.
150204 19:00:18  innobackupex: All tables unlockedinnobackupex: Backup created in directory '/data/mysql/databak/2015-02-04_19-00-03'
150204 19:00:18  innobackupex: Connection to database server closed
150204 19:00:18  innobackupex: completed OK!

 

2. 第一次增量备份
#--incremental:增量备份的文件夹
#--incremental-dir:针对哪个做增量备份

[root@server databak]# innobackupex --defaults-file=/usr/local/mysql/my.cnf --user=root --password=redhat --incremental  /data/mysql/databak/ --incremental-dir /data/mysql/databak/2015-02-04_19-00-03/InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona LLC and/or its affiliates 2009-2013.  All Rights Reserved.This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.150204 19:03:58  innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_file=/usr/local/mysql/my.cnf;mysql_read_default_group=xtrabackup' as 'root'  (using password: YES).
150204 19:03:58  innobackupex: Connected to MySQL server
150204 19:03:58  innobackupex: Executing a version check against the server...
150204 19:03:58  innobackupex: Done.
150204 19:03:58  innobackupex: Starting the backup operationIMPORTANT: Please check that the backup run completes successfully.At the end of a successful backup run innobackupexprints "completed OK!".innobackupex:  Using server version 5.5.30innobackupex: Created backup directory /data/mysql/databak/2015-02-04_19-03-58150204 19:03:58  innobackupex: Starting ibbackup with command: xtrabackup  --defaults-file="/usr/local/mysql/my.cnf"  --defaults-group="mysqld" --backup --suspend-at-end --target-dir=/data/mysql/databak/2015-02-04_19-03-58 --tmpdir=/tmp --extra-lsndir='/tmp' --incremental-basedir='/data/mysql/databak/2015-02-04_19-00-03'
innobackupex: Waiting for ibbackup (pid=19349) to suspend
innobackupex: Suspend file '/data/mysql/databak/2015-02-04_19-03-58/xtrabackup_suspended_2'xtrabackup version 2.2.8 based on MySQL server 5.6.22 Linux (x86_64) (revision id: )
incremental backup from 1602080 is enabled.
xtrabackup: uses posix_fadvise().
xtrabackup: cd to /data/mysql/data/
xtrabackup: open files limit requested 0, set to 1024
xtrabackup: using the following InnoDB configuration:
xtrabackup:   innodb_data_home_dir = /data/mysql/data
xtrabackup:   innodb_data_file_path = ibdata1:1G:autoextend
xtrabackup:   innodb_log_group_home_dir = ./
xtrabackup:   innodb_log_files_in_group = 2
xtrabackup:   innodb_log_file_size = 5242880
xtrabackup: using O_DIRECT
>> log scanned up to (1602919)
xtrabackup: Generating a list of tablespaces
xtrabackup: using the full scan for incremental backup
[01] Copying /data/mysql/data/ibdata1 to /data/mysql/databak/2015-02-04_19-03-58/ibdata1.delta
>> log scanned up to (1602919)
>> log scanned up to (1602919)
>> log scanned up to (1602919)
>> log scanned up to (1602919)
>> log scanned up to (1602919)
[01]        ...done
[01] Copying ./test/students.ibd to /data/mysql/databak/2015-02-04_19-03-58/test/students.ibd.delta
[01]        ...done
>> log scanned up to (1602919)
xtrabackup: Creating suspend file '/data/mysql/databak/2015-02-04_19-03-58/xtrabackup_suspended_2' with pid '19349'150204 19:04:05  innobackupex: Continuing after ibbackup has suspended
150204 19:04:05  innobackupex: Executing FLUSH TABLES WITH READ LOCK...
150204 19:04:05  innobackupex: All tables locked and flushed to disk150204 19:04:05  innobackupex: Starting to backup non-InnoDB tables and files
innobackupex: in subdirectories of '/data/mysql/data/'
innobackupex: Backing up files '/data/mysql/data//performance_schema/*.{frm,isl,MYD,MYI,MAD,MAI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}' (18 files)
>> log scanned up to (1602919)
innobackupex: Backing up file '/data/mysql/data//test/students.frm'
innobackupex: Backing up files '/data/mysql/data//mysql/*.{frm,isl,MYD,MYI,MAD,MAI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}' (72 files)
150204 19:04:06  innobackupex: Finished backing up non-InnoDB tables and files150204 19:04:06  innobackupex: Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS...
150204 19:04:06  innobackupex: Waiting for log copying to finishxtrabackup: The latest check point (for incremental): '1602919'
xtrabackup: Stopping log copying thread.
.>> log scanned up to (1602919)xtrabackup: Creating suspend file '/data/mysql/databak/2015-02-04_19-03-58/xtrabackup_log_copied' with pid '19349'
xtrabackup: Transaction log of lsn (1602919) to (1602919) was copied.
150204 19:04:07  innobackupex: All tables unlockedinnobackupex: Backup created in directory '/data/mysql/databak/2015-02-04_19-03-58'
150204 19:04:07  innobackupex: Connection to database server closed
150204 19:04:07  innobackupex: completed OK!
[root@server databak]# ls
2015-02-04_19-00-03  2015-02-04_19-03-58
[root@server databak]# ll
total 8
drwxr-xr-x. 5 root root 4096 Feb  4 19:00 2015-02-04_19-00-03
drwxr-xr-x. 5 root root 4096 Feb  4 19:04 2015-02-04_19-03-58
[root@server databak]# du -sh *
1.1G    2015-02-04_19-00-03
1.5M    2015-02-04_19-03-58

 

3. 模拟数据丢失

mysql> drop database test;
Query OK, 1 row affected (0.14 sec)mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)

 

4. 将全备数据执行prepare

[root@server 2015-02-04_19-03-58]# innobackupex --apply-log --redo-only /data/mysql/databak/2015-02-04_19-00-03/InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona LLC and/or its affiliates 2009-2013.  All Rights Reserved.This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.150204 19:10:15  innobackupex: Starting the apply-log operationIMPORTANT: Please check that the apply-log run completes successfully.At the end of a successful apply-log run innobackupexprints "completed OK!".150204 19:10:15  innobackupex: Starting ibbackup with command: xtrabackup  --defaults-file="/data/mysql/databak/2015-02-04_19-00-03/backup-my.cnf"  --defaults-group="mysqld" --prepare --target-dir=/data/mysql/databak/2015-02-04_19-00-03 --apply-log-onlyxtrabackup version 2.2.8 based on MySQL server 5.6.22 Linux (x86_64) (revision id: )
xtrabackup: cd to /data/mysql/databak/2015-02-04_19-00-03
xtrabackup: This target seems to be not prepared yet.
xtrabackup: xtrabackup_logfile detected: size=2097152, start_lsn=(1602080)
xtrabackup: using the following InnoDB configuration for recovery:
xtrabackup:   innodb_data_home_dir = ./
xtrabackup:   innodb_data_file_path = ibdata1:1G:autoextend
xtrabackup:   innodb_log_group_home_dir = ./
xtrabackup:   innodb_log_files_in_group = 1
xtrabackup:   innodb_log_file_size = 2097152
xtrabackup: using the following InnoDB configuration for recovery:
xtrabackup:   innodb_data_home_dir = ./
xtrabackup:   innodb_data_file_path = ibdata1:1G:autoextend
xtrabackup:   innodb_log_group_home_dir = ./
xtrabackup:   innodb_log_files_in_group = 1
xtrabackup:   innodb_log_file_size = 2097152
xtrabackup: Starting InnoDB instance for recovery.
xtrabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter)
InnoDB: Using atomics to ref count buffer pool pages
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Memory barrier is not used
InnoDB: Compressed tables use zlib 1.2.3
InnoDB: Using CPU crc32 instructions
InnoDB: Initializing buffer pool, size = 100.0M
InnoDB: Completed initialization of buffer pool
InnoDB: Highest supported file format is Barracuda.
InnoDB: The log sequence numbers 1602070 and 1602070 in ibdata files do not match the log sequence number 1602080 in the ib_logfiles!
InnoDB: Database was not shutdown normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages 
InnoDB: from the doublewrite buffer...[notice (again)]If you use binary log and don't use any hack of group commit,
  the binary log position seems to be:xtrabackup: starting shutdown with innodb_fast_shutdown = 1
InnoDB: Starting shutdown...
InnoDB: Shutdown completed; log sequence number 1602080
150204 19:10:16  innobackupex: completed OK!

 

5. 将增量备份数据合并到全备中

[root@server 2015-02-04_19-03-58]# innobackupex --apply-log --redo-only --incremental /data/mysql/databak/2015-02-04_19-00-03/ --incremental-dir=/data/mysql/databak/2015-02-04_19-03-58/InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona LLC and/or its affiliates 2009-2013.  All Rights Reserved.This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.150204 19:10:19  innobackupex: Starting the apply-log operationIMPORTANT: Please check that the apply-log run completes successfully.At the end of a successful apply-log run innobackupexprints "completed OK!".150204 19:10:19  innobackupex: Starting ibbackup with command: xtrabackup  --defaults-file="/data/mysql/databak/2015-02-04_19-00-03/backup-my.cnf"  --defaults-group="mysqld" --prepare --target-dir=/data/mysql/databak/2015-02-04_19-00-03 --apply-log-only --incremental-dir=/data/mysql/databak/2015-02-04_19-03-58/xtrabackup version 2.2.8 based on MySQL server 5.6.22 Linux (x86_64) (revision id: )
incremental backup from 1602080 is enabled.
xtrabackup: cd to /data/mysql/databak/2015-02-04_19-00-03
xtrabackup: This target seems to be already prepared.
xtrabackup: xtrabackup_logfile detected: size=2097152, start_lsn=(1602919)
xtrabackup: using the following InnoDB configuration for recovery:
xtrabackup:   innodb_data_home_dir = ./
xtrabackup:   innodb_data_file_path = ibdata1:1G:autoextend
xtrabackup:   innodb_log_group_home_dir = /data/mysql/databak/2015-02-04_19-03-58/
xtrabackup:   innodb_log_files_in_group = 1
xtrabackup:   innodb_log_file_size = 2097152
xtrabackup: Generating a list of tablespaces
xtrabackup: page size for /data/mysql/databak/2015-02-04_19-03-58//ibdata1.delta is 16384 bytes
Applying /data/mysql/databak/2015-02-04_19-03-58//ibdata1.delta to ./ibdata1...
xtrabackup: page size for /data/mysql/databak/2015-02-04_19-03-58//test/students.ibd.delta is 16384 bytes
Applying /data/mysql/databak/2015-02-04_19-03-58//test/students.ibd.delta to ./test/students.ibd...
xtrabackup: using the following InnoDB configuration for recovery:
xtrabackup:   innodb_data_home_dir = ./
xtrabackup:   innodb_data_file_path = ibdata1:1G:autoextend
xtrabackup:   innodb_log_group_home_dir = /data/mysql/databak/2015-02-04_19-03-58/
xtrabackup:   innodb_log_files_in_group = 1
xtrabackup:   innodb_log_file_size = 2097152
xtrabackup: Starting InnoDB instance for recovery.
xtrabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter)
InnoDB: Using atomics to ref count buffer pool pages
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Memory barrier is not used
InnoDB: Compressed tables use zlib 1.2.3
InnoDB: Using CPU crc32 instructions
InnoDB: Initializing buffer pool, size = 100.0M
InnoDB: Completed initialization of buffer pool
InnoDB: Highest supported file format is Barracuda.
InnoDB: The log sequence numbers 1602070 and 1602070 in ibdata files do not match the log sequence number 1602919 in the ib_logfiles!
InnoDB: Database was not shutdown normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages 
InnoDB: from the doublewrite buffer...[notice (again)]If you use binary log and don't use any hack of group commit,
  the binary log position seems to be:xtrabackup: starting shutdown with innodb_fast_shutdown = 1
InnoDB: Starting shutdown...
InnoDB: Shutdown completed; log sequence number 1602919
innobackupex: Starting to copy non-InnoDB files in '/data/mysql/databak/2015-02-04_19-03-58/'
innobackupex: to the full backup directory '/data/mysql/databak/2015-02-04_19-00-03'
innobackupex: Copying '/data/mysql/databak/2015-02-04_19-03-58/xtrabackup_info' to '/data/mysql/databak/2015-02-04_19-00-03/xtrabackup_info'
innobackupex: Copying '/data/mysql/databak/2015-02-04_19-03-58/performance_schema/db.opt' to '/data/mysql/databak/2015-02-04_19-00-03/performance_schema/db.opt'
innobackupex: Copying '/data/mysql/databak/2015-02-04_19-03-58/performance_schema/events_waits_summary_by_thread_by_event_name.frm' to '/data/mysql/databak/2015-02-04_19-00-03/performance_schema/events_waits_summary_by_thread_by_event_name.frm'
innobackupex: Copying '/data/mysql/databak/2015-02-04_19-03-58/performance_schema/file_summary_by_instance.frm' to '/data/mysql/databak/2015-02-04_19-00-03/performance_schema/file_summary_by_instance.frm'
..........
150204 19:10:20 innobackupex: completed OK!

6. 停止mysqld服务,恢复数据

[root@server 2015-02-04_19-03-58]# /etc/init.d/mysqld stop
Shutting down MySQL...                                     [  OK  ]
[root@server data]# innobackupex --defaults-file=/usr/local/mysql/my.cnf --copy-back /data/mysql/databak/2015-02-04_19-00-03/InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona LLC and/or its affiliates 2009-2013.  All Rights Reserved.This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.150204 19:13:47  innobackupex: Starting the copy-back operationIMPORTANT: Please check that the copy-back run completes successfully.At the end of a successful copy-back run innobackupexprints "completed OK!".innobackupex: Starting to copy files in '/data/mysql/databak/2015-02-04_19-00-03'

.........innobackupex: Starting to copy InnoDB system tablespace innobackupex:
in '/data/mysql/databak/2015-02-04_19-00-03' innobackupex: back to original InnoDB data directory '/data/mysql/data' innobackupex: Copying '/data/mysql/databak/2015-02-04_19-00-03/ibdata1' to '/data/mysql/data/ibdata1'innobackupex: Starting to copy InnoDB undo tablespaces innobackupex: in '/data/mysql/databak/2015-02-04_19-00-03' innobackupex: back to '/data/mysql/data/'innobackupex: Starting to copy InnoDB log files innobackupex: in '/data/mysql/databak/2015-02-04_19-00-03' innobackupex: back to original InnoDB log directory '/data/mysql/data/' innobackupex: Finished copying back files.150204 19:13:53 innobackupex: completed OK!

 

7. 对恢复的文件修改权限

[root@server data]# chown -R mysql:mysql *
[root@server data]# chown -R mysql:root mysql/

 

8. 启动mysql服务

[root@server data]# /etc/init.d/mysqld start
Starting MySQL...                                          [  OK  ]

 

done ^_^

转载于:https://www.cnblogs.com/forilen/p/4273133.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/257660.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

《大话设计模式》 国外资料

It is not easy to remember all design patterns. Here are some stories about design patterns which might help! Creational Singleton – Only one president in AmericaFactory – A factory that produces humanAbstract Factory – An abstract factory to produce CP…

python arcgis 图书_arcgis python

本书作者是GIS发方面的知名作者&#xff0c;曾著有《JavaScript构建Web和ArcGIS Server应用实战》(Building Web and Mobile ArcGIS Server Applications with JavaScript)一书。 本书内容易学易懂&#xff0c;帮助读者成为GIS发高手。《面向ArcGIS的Python脚本编程》是一本指导…

博客园客户端UAP开发随笔 -- App连接云端内容的桥梁:WebView

当你辛苦的从网上爬下来一篇文章之后&#xff0c;怎么在你的应用内展示这些包含HTML标记的文章&#xff1f;如果你使用的是Javascript开发应用&#xff0c;恭喜你&#xff0c;直接塞进页面就可以了&#xff0c;同时说明你很熟悉页面开发&#xff0c;而现在windows也支持这种方式…

C4.5

C4.5是机器学习算法中的另一个分类决策树算法&#xff0c;它是基于ID3算法进行改进后的一种重要算法&#xff0c;相比于ID3算法&#xff0c;改进有如下几个要点&#xff1a; 用信息增益率来选择属性。ID3选择属性用的是子树的信息增益&#xff0c;这里可以用很多方法来定义信息…

谈谈分布式事务之三: System.Transactions事务详解[下篇]

在前面一篇给出的Transaction的定义中&#xff0c;信息的读者应该看到了一个叫做DepedentClone的方法。该方法对用于创建基于现有Transaction对 象的“依赖事务&#xff08;DependentTransaction&#xff09;”。不像可提交事务是一个独立的事务对象&#xff0c;依赖事务依附于…

iOS开发系列--触摸事件、手势识别、摇晃事件、耳机线控

-- iOS事件全面解析 概览 iPhone的成功很大一部分得益于它多点触摸的强大功能&#xff0c;乔布斯让人们认识到手机其实是可以不用按键和手写笔直接操作的&#xff0c;这不愧为一项伟大的设计。今天我们就针对iOS的触摸事件&#xff08;手势操作&#xff09;、运动事件、远程控制…

python为什么忽然火了_为什么Python突然就火了起来了呢?

近日&#xff0c;TIOBE发布10月编程语言排行榜显示&#xff0c;15年来TIOBE指数的前8名一直保持不变&#xff0c;而Python正在成为一种新的大型语言。越来越多的企业在使用Python进行开发&#xff0c;越来越多的人正在加入Python程序员行列!TIOBE 10月编程语言排行榜前20名Pyth…

ARP扫描工具arp-scan

2019独角兽企业重金招聘Python工程师标准>>> ARP扫描工具arp-scan arp-scan是Kali Linux自带的一款ARP扫描工具。该工具可以进行单一目标扫描&#xff0c;也可以进行批量扫描。批量扫描的时候&#xff0c;用户可以通过CIDR、地址范围或者列表文件的方式指定。该工具…

elementui el-from 怎样显示图片_vue2.0使用weui.js的uploader组件上传图片(兼容移动端)...

本文已同步到专业技术网站 www.sufaith.com, 该网站专注于前后端开发技术与经验分享, 包含Web开发、Nodejs、Python、Linux、IT资讯等板块.最近在使用 vue2.0开发微信公众号网页 其中涉及到 选择图片, 图片的压缩上传, 预览, 删除等操作。项目整体UI框架使用的是 vux, 但可惜的…

面向对象分析

在需求获取阶段&#xff0c;开发人员关注于理解用户以及他们的使用要求。而在需求分析阶段&#xff0c;开发人员关注于理解系统需要构建的内容&#xff0c;其核心是产生一个准确的、完整的、一致的和可验证的系统模型&#xff0c;称为分析模型。 面对对象的分析模型由三个独立的…

51nod 1050 循环数组最大子段和

1050 循环数组最大子段和 N个整数组成的循环序列a[1],a[2],a[3],…,a[n]&#xff0c;求该序列如a[i]a[i1]…a[j]的连续的子段和的最大值&#xff08;循环序列是指n个数围成一个圈&#xff0c;因此需要考虑a[n-1],a[n],a[1],a[2]这样的序列&#xff09;。当所给的整数均为负数时…

Spark- Linux下安装Spark

Spark- Linux下安装Spark 前期部署 1.JDK安装&#xff0c;配置PATH 可以参考之前配置hadoop等配置 2.下载spark-1.6.1-bin-hadoop2.6.tgz,并上传到服务器解压 [rootsrv01 ~]# tar -xvzf spark-1.6.1-hadoop2.6.tgz /usr/spark-1.6.1-hadoop2.6 3.在 /usr 下创建软链接到目标文…

python需要背的英语单词怎么写_学Python必须背的42个常见单词,看看你都会吗?...

这42个单词是学习Python必须背会的单词&#xff0c;也是代码中常见的单词。希望你能都背下来&#xff01;&#xff01;1. adult [ˈdʌlt] 成年人2. authentication [ɔːˌθentɪˈkeɪʃn] 身份验证、认证、鉴定3. bit [bɪt] 稍微、小量、小块、一点4. byte [baɪt] …

asp.net mvc4开启SqlServer 会话共享模式

2019独角兽企业重金招聘Python工程师标准>>> 应用部署结构&#xff08;精简&#xff09;: 站点部署在Nginx后面&#xff0c;以Nginx作为反向代理&#xff0c;不希望在Nginx上设置ip_hash&#xff0c;实现比较真实的负载均衡效果。 这时考虑到需要让site1和site2同时…

【转】(五)unity4.6Ugui中文教程文档-------概要-UGUI Interaction Components

原创至上&#xff0c;移步请戳&#xff1a;&#xff08;五&#xff09;unity4.6Ugui中文教程文档-------概要-UGUI Interaction Components 4、Interaction Components 本节涵盖了处理交互&#xff0c;例如鼠标或触摸事件和使用键盘或控制器交互的 UI系统中的组件。 4.1 Select…

j2ee 简单网站搭建:(十)jquery ztree 插件使用入门

为什么80%的码农都做不了架构师&#xff1f;>>> 《j2ee 简单网站搭建&#xff1a;&#xff08;一&#xff09; windows 操作系统下使用 eclipse 建立 maven web 项目》《j2ee 简单网站搭建&#xff1a;&#xff08;二&#xff09;添加和配置 spring spring-mvc 的…

实习报告

实习时间&#xff1a;2016/2/18-2016/2/24 实习地点&#xff1a;陕西省米脂县公安局网络警察大队     实习报告&#xff1a; 如今的社会&#xff0c;网络高度发展&#xff0c;一些人随着时代的潮流利用网络发家致富&#xff0c;而有些人利用网络监管的一些漏洞&#xff0c;…

Android成长日记-使用GridView显示多行数据

本节将实现以下效果 Ps&#xff1a;看起来很不错的样子吧&#xff0c;而且很像九宫格/se ----------------------------------------------------------------------- 下面进入正题[s1] &#xff1a; Step 1&#xff1a;新建Layout&#xff0c;里面创建GridView <GridView a…

夺命雷公狗---微信开发39----微信语言识别接口1

语音识别接口的基本介绍 注意&#xff1a; 由于客户端缓存&#xff0c;开发者开启或者关闭语音识别功能&#xff0c;对新关注者立即生效&#xff0c;对已关注用户需要24小时生效&#xff0c;开发者可以从新关注帐号进行测试。 我们可以在测试号下方的体验接口权限表里面找到“接…

java applet 文本框_Java Applet 文本框 TextField 小例 | 学步园

一个Java Applet程序中必须有一个类是Applet类的子类&#xff0c;成为该子类是Java Applet的主类&#xff0c; 并且必须是public class。 Applet类是包java.applet中的一个类&#xff0c; 同时它还是包java.awt中Container(容器)类的子类。因此Java Applet的主类的实例是一个容…