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.pswp.cn/news/257660.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/257660.shtml
英文地址,請注明出處:http://en.pswp.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…

DHCP基本配置

第一步 安裝 DHCP [rootlocalhost ~]# yum install dhcp dhcp-devel DHCP文件簡介 /etc/dhcp/dhcpd.conf #主配置文件&#xff0c;除了括號那欄&#xff0c;其它都要結尾 ; 這樣的分號 /var/lib/dhcpd/dhcpd.leases #IP地址租約在這里 第二步 配置 DHCP 主文件配置[rootlocalho…

python arcgis 圖書_arcgis python

本書作者是GIS發方面的知名作者&#xff0c;曾著有《JavaScript構建Web和ArcGIS Server應用實戰》(Building Web and Mobile ArcGIS Server Applications with JavaScript)一書。 本書內容易學易懂&#xff0c;幫助讀者成為GIS發高手。《面向ArcGIS的Python腳本編程》是一本指導…

scrapy 讓指定的spider執行指定的pipeline

處理scrapy中包括多個pipeline時如何讓spider執行制定的pipeline管道&#xff11;:創建一個裝飾器from scrapy.exceptions import DropItemimport functools當有多個pipeline時,判斷spider如何執行指定的管道 def check_spider_pipeline(process_item_method): functools.wr…

五大常用算法之三:貪心算法

一、基本概念&#xff1a; 所謂貪心算法是指&#xff0c;在對問題求解時&#xff0c;總是做出在當前看來是最好的選擇。也就是說&#xff0c;不從整體最優上加以考慮&#xff0c;他所做出的僅是在某種意義上的局部最優解。 貪心算法沒有固定的算法框架&#xff0c;算法設計的關…

python學習筆記列表和元組(三)

列表&#xff08;list&#xff09;是Python以及其他語言中最常用到的數據結構之一。Python使用使用中括號 [ ] 來解析列表。列表是可變的&#xff08;mutable&#xff09;——可以改變列表的內容。對應操作&#xff1a;1、查&#xff08;[]切片操作&#xff09; name [tom,張三…

python 函數的調用的時候參數的傳遞_Python Unittest;如何獲取調用函數時傳遞的參數?...

我試圖做一個單元測試來檢查這個python函數(dispatch)是否傳遞了正確的參數來處理\u結果。在在dispatch中調用處理“unu result”的函數時&#xff0c;有沒有方法“劫持”輸入參數&#xff1f;我沒有在調度函數中修改代碼的權限。在以下是單元測試中的want預覽&#xff1a;impo…

博客園客戶端UAP開發隨筆 -- App連接云端內容的橋梁:WebView

當你辛苦的從網上爬下來一篇文章之后&#xff0c;怎么在你的應用內展示這些包含HTML標記的文章&#xff1f;如果你使用的是Javascript開發應用&#xff0c;恭喜你&#xff0c;直接塞進頁面就可以了&#xff0c;同時說明你很熟悉頁面開發&#xff0c;而現在windows也支持這種方式…

listview與gridview點擊時的背景色取消

在布局文件里面的listview控件添加以下代碼android:listSelector"#00000000" //透明色 可以自己選擇點擊顏色轉載于:https://www.cnblogs.com/yulook/p/5219932.html

解決yum命令失效,vim: command not found

安裝python3模塊時&#xff0c;yum命令無法執行錯誤:**/usr/bin/yum: line 3: import: command not found/usr/bin/yum: line 4: try:: command not found/usr/bin/yum: line 5: import: command not found/usr/bin/yum: line 6: except: command not found/usr/bin/yum: line …

C4.5

C4.5是機器學習算法中的另一個分類決策樹算法&#xff0c;它是基于ID3算法進行改進后的一種重要算法&#xff0c;相比于ID3算法&#xff0c;改進有如下幾個要點&#xff1a; 用信息增益率來選擇屬性。ID3選擇屬性用的是子樹的信息增益&#xff0c;這里可以用很多方法來定義信息…

(周日賽)Sort the Array

題意&#xff1a;一段數字&#xff0c;逆置其中兩個使其遞增 DescriptionBeing a programmer, you like arrays a lot. For your birthday, your friends have given you an array a consisting of ndistinct integers. Unfortunately, the size of a is too small. You want a…

jqgrid學習(三)

1.修改jqgrid自帶的行編輯按鈕樣式 //jqgrid默認的行編輯樣式 {name : ,index : ,width : 70,fixed : true,sortable : false,resize : false,formatter : actions,},//修改每行的編輯按鈕圖標為目標樣式//當表格中數據加載完畢后&#xff0c;執行此方法 loadComplete : functi…

事件Event對象

事件event對象 當事件發生時&#xff0c;會向調用函數傳遞一個event對象&#xff0c;event對象記錄當前事件發生時的環境信息。 一個事件只能對應一個event對象&#xff0c;并且event對象是短暫存在的。 DOM中的event對象的使用方法 1、在HTML標記中&#xff0c;通過事件來調用…

解決mac osx下pip安裝ipython權限的問題

1pip install ipython --user -U下面是pip install gevent的錯誤提示&#xff0c; 又是 Operation not permitted … 12345#xiaorui.ccpip install gevent...raise Error, errorsError: [(/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_marker…

談談分布式事務之三: System.Transactions事務詳解[下篇]

在前面一篇給出的Transaction的定義中&#xff0c;信息的讀者應該看到了一個叫做DepedentClone的方法。該方法對用于創建基于現有Transaction對 象的“依賴事務&#xff08;DependentTransaction&#xff09;”。不像可提交事務是一個獨立的事務對象&#xff0c;依賴事務依附于…

HDU——2444 The Accomodation of Students

The Accomodation of Students Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)                    Total Submission(s): 7086 Accepted Submission(s): 3167 Problem DescriptionThere are a group of studen…

iOS開發系列--觸摸事件、手勢識別、搖晃事件、耳機線控

-- iOS事件全面解析 概覽 iPhone的成功很大一部分得益于它多點觸摸的強大功能&#xff0c;喬布斯讓人們認識到手機其實是可以不用按鍵和手寫筆直接操作的&#xff0c;這不愧為一項偉大的設計。今天我們就針對iOS的觸摸事件&#xff08;手勢操作&#xff09;、運動事件、遠程控制…

關于Hyper-V備份的四大注意事項

盡管Hyper-V備份相對簡單&#xff0c;但備份管理員仍需注意四大問題。這四方面的問題在創建備份時可能不太重要&#xff0c;但在備份恢復時影響甚大。 1、對于虛擬機來說不僅意味著虛擬磁盤 就目前來看&#xff0c;企業在執行Hyper-V備份時最常見的誤區就是把虛擬機當做物理服務…

python為什么忽然火了_為什么Python突然就火了起來了呢?

近日&#xff0c;TIOBE發布10月編程語言排行榜顯示&#xff0c;15年來TIOBE指數的前8名一直保持不變&#xff0c;而Python正在成為一種新的大型語言。越來越多的企業在使用Python進行開發&#xff0c;越來越多的人正在加入Python程序員行列!TIOBE 10月編程語言排行榜前20名Pyth…