[root@testdb mysql]# innobackupex-1.5.1 --user=root --password=xxx --defaults-file=/etc/my.cnf /var/backups
InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy.
All Rights Reserved.
This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.
IMPORTANT: Please check that the backup run completes successfully.
At the end of a successful backup run innobackupex-1.5.1
prints "completed OK!".
.............
innobackupex-1.5.1: Backup created in directory '/var/backups/2010-12-23_16-06-19'
innobackupex-1.5.1: MySQL binlog position: filename 'testdb-bin.000093', position 798
101223 16:06:54 innobackupex-1.5.1: completed OK!
[root@testdb mysql]# ls -al
total 376484
drwxr-xr-x 7 mysql mysql 4096 Dec 23 15:47 .
drwxr-xr-x 44 root root 4096 Sep 30 17:45 ..
-rw-r--r-- 1 root root 145841328 Nov 25 15:35 alldatabase.sql
-rw------- 1 mysql mysql 262 Nov 29 11:54 .bash_history
-rw-r--r-- 1 mysql mysql 228589568 Dec 23 16:06 ibdata1
-rw-r--r-- 1 mysql mysql 5242880 Dec 23 16:06 ib_logfile0
-rw-r--r-- 1 mysql mysql 5242880 Dec 23 15:46 ib_logfile1
-rw-r--r-- 1 root root 605 Nov 25 15:36 log.sql
drwx------ 2 mysql mysql 4096 Nov 29 13:33 market
-rw-rw---- 1 mysql mysql 68 Dec 23 15:47 master.info
drwx--x--x 2 mysql mysql 4096 Nov 29 13:33 mysql
srwxrwxrwx 1 mysql mysql 0 Dec 23 15:47 mysql.sock
-rw-r--r-- 1 root root 6 Sep 30 17:57 mysql_upgrade_info
drwx------ 2 mysql mysql 4096 Nov 29 13:33 orders
-rw-rw---- 1 mysql mysql 55 Dec 23 15:47 relay-log.info
-rw-r--r-- 1 root root 115 Sep 30 17:45 RPM_UPGRADE_HISTORY
drwxr-xr-x 2 mysql mysql 4096 Nov 29 13:34 test
-rw-rw---- 1 mysql mysql 1102 Dec 23 15:45 testdb-bin.000092
-rw-rw---- 1 mysql mysql 798 Dec 23 16:06 testdb-bin.000093
-rw-rw---- 1 mysql mysql 40 Dec 23 15:47 testdb-bin.index
-rw-rw---- 1 mysql root 2404 Oct 8 15:05 testdb.err
-rw-rw---- 1 mysql mysql 5 Dec 23 15:47 testdb.pid
-rw-rw---- 1 mysql mysql 156 Dec 23 15:47 testdb-relay-bin.001567
-rw-rw---- 1 mysql mysql 253 Dec 23 15:47 testdb-relay-bin.001568
-rw-rw---- 1 mysql mysql 52 Dec 23 15:47 testdb-relay-bin.index
-rw-rw---- 1 mysql mysql 2535 Oct 20 17:03 testdb-slow.log
drwx------ 2 mysql mysql 4096 Nov 29 13:34 wwf
[root@testdb mysql]# service mysql stop
Shutting down MySQL..... [ OK ]
[root@testdb mysql]# rm -rf *
[root@testdb mysql]# ls -al
total 24
drwxr-xr-x 2 mysql mysql 4096 Dec 23 16:08 .
drwxr-xr-x 44 root root 4096 Sep 30 17:45 ..
-rw------- 1 mysql mysql 262 Nov 29 11:54 .bash_history
[root@testdb mysql]# innobackupex-1.5.1 --apply-log --defaults-file=/etc/my.cnf /var/backups/2010-12-23_16-06-19
InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy.
All Rights Reserved.
This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.
IMPORTANT: Please check that the apply-log run completes successfully.
At the end of a successful apply-log run innobackupex-1.5.1
prints "completed OK!".
.............
xtrabackup: starting shutdown with innodb_fast_shutdown = 1
101223 16:09:26 InnoDB: Starting shutdown...
101223 16:09:27 InnoDB: Shutdown completed; log sequence number 0 888714764
101223 16:09:27 innobackupex-1.5.1: completed OK!
[root@testdb mysql]# innobackupex-1.5.1 --copy-back --defaults-file=/etc/my.cnf /var/backups/2010-12-23_16-06-19
InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy.
All Rights Reserved.
This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.
IMPORTANT: Please check that the copy-back run completes successfully.
At the end of a successful copy-back run innobackupex-1.5.1
prints "completed OK!".
................
innobackupex-1.5.1: Finished copying back files.
101223 16:10:04 innobackupex-1.5.1: completed OK!
.
[root@testdb mysql]# chown -R mysql:mysql *
.
[root@testdb mysql]# service mysql start
Starting MySQL. [ OK ]
mysql> select * from test_InnoDB;
+------+------+
| a | b |
+------+------+
| 11 | 2323 |
| 11 | 2323 |
| 11 | 2323 |
| 11 | 2323 |
| 11 | 2323 |
| 11 | 2323 |
| 11 | 2323 |
+------+------+
7 rows in set (0.00 sec)
mysql> exit
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/758322/viewspace-682486/ ,如需转载,请注明出处,否则将追究法律责任。