1:创建测试表和测试库
如果需要快速建立测试表和库的话,参考之前写的这篇博客:
http://www.cnblogs.com/xiaoit/p/3376685.html
create database backup_test;

  

CREATE TABLE `backup` (
`id` int(11) NOT NULL AUTO_INCREMENT ,
`name` varchar(20) NOT NULL DEFAULT '' ,
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ,
`del` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=myisam DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
mysql> INSERT INTO backup (name) VALUES ('Hi'),('Hi');

  

2:全备份

innobackupex --defaults-file=/etc/my.cnf --user=root --password='ge0513' --slave-info  /root/

 

3:再次插入数据

INSERT INTO backup (name) VALUES ('Hi1'),('Hi1'),('Hi1'),('Hi1'),('Hi1'),('Hi1'),('Hi1'),('Hi1'),('Hi1'),('Hi1'),('Hi1'),('Hi1'),('Hi1'),('Hi1'),('Hi1'),('Hi1'),('Hi1'),('Hi1');

 

4:增量备份

innobackupex --defaults-file=/etc/my.cnf --user=root --password='ge0513' --incremental-basedir=/root/2015-05-25_20-54-39/ --incremental /root/

  

150525 20:56:05  innobackupex: completed OK!
[root@localhost ~]# ls
2015-05-25_20-54-39 526.sql anaconda-ks.cfg Documents install.log Music Public sql.sql Videos
2015-05-25_20-56-00 all.sql Desktop Downloads install.log.syslog Pictures software Templates
[root@localhost ~]# cd 2015-05-25_20-56-00/
[root@localhost 2015-05-25_20-56-00]# ls
backup-my.cnf ibdata1.delta mysql test xtrabackup_checkpoints xtrabackup_logfile
dbmm ibdata1.meta performance_schema xtrabackup_binlog_info xtrabackup_info
[root@localhost 2015-05-25_20-56-00]# cat xtrabackup_checkpoints
backup_type = incremental
from_lsn = 68178003
to_lsn = 68201658
last_lsn = 68201658
compact = 0

  

5:进入备份目录查看备份信息

cat xtrabackup_checkpoints

  

6:增量还原

innobackupex --defaults-file=/etc/my.cnf --user=root --password='ge0513' --apply-log --redo-only /root/2015-05-25_20-54-39/

  

innobackupex --defaults-file=/etc/my.cnf --user=root --password='ge0513'  --redo-only /root/2015-05-25_20-56-00/ --incremental-dir=/root/2015-05-25_20-56-00/

  

												

最新文章

  1. 《Note --- Unreal 4 --- Sample analyze --- StrategyGame(continue...)》
  2. C++小项目:directx11图形程序(三):graphicsclass
  3. OK6410移植madplay播放器,王明学learn
  4. ABBYY如何使用电子邮件发送OCR结果
  5. AppCan移动技术全景图:创新、协作、支撑
  6. maven 本地仓库nexus的安装
  7. git rebase无法处理的问题
  8. Android 自定义View修炼-自定义HorizontalScrollView视图实现仿ViewPager效果
  9. iOS RunTime你知道了总得用一下
  10. [LeetCode] Find Largest Value in Each Tree Row 找树每行最大的结点值
  11. sybase central 报 NullPointerException 解决
  12. Appscanner实验还原code1
  13. [转]在centos 6.4下安装opencv 2.3.1
  14. python selenium 定制启动Chrome的选项注意事项(十九)
  15. loadRunner手动关联, web_reg_save_param_regexp()函数正则匹配字符,赋值给变量
  16. logstash安装与logstash-input-jdbc插件使用
  17. SNMP代理软件开发
  18. databinding在android studio2.3版本后不再默认支持使用
  19. Gitlab CI-3.遇到的问题
  20. 2018BNU校赛总决赛

热门文章

  1. java7 NIO2 watching service API
  2. 如何在 Xcode 中修改应用的名字
  3. 梅尔罗斯百度云在线观看迅雷下载Patrick Melrose磁力BT下载
  4. Build Web Apps in Node and Express视频下载
  5. actuator监控
  6. HTML5 本地文件操作之FileSystemAPI实例(二)
  7. 哈,今天终于在电脑上吧oracle给装上了
  8. postgresql数据库用户名密码验证失败
  9. [leetcode]Reverse Words in a String @ Python
  10. Backbone.js 使用模板