Chinaunix首页 | 论坛 | 博客

ice

  • 博客访问: 63383
  • 博文数量: 2
  • 博客积分: 390
  • 博客等级: 一等列兵
  • 技术积分: 36
  • 用 户 组: 普通用户
  • 注册时间: 2012-06-26 13:24
文章分类

全部博文(2)

文章存档

2015年(2)

我的朋友

分类: Mysql/postgreSQL

2015-02-07 14:30:08

实验环境:
系统:CentOS release 6.2 (Final)
数据库版本:mysql  5.6.22-log        

           
实验步骤:
在主上:
1. set sql_log_bin=0;

2. use test; CREATE TABLE `export_test` (
  `a` int(11) DEFAULT NULL
) ENGINE=InnoDB;

3. insert into export_test values(11),(12),(13),(14)

4. xtrabackup --backup --datadir=/var/lib/mysql/ --target-dir=/root/backups/

5. xtrabackup --prepare --export --target-dir=/root/backups/  =======〉 把export_test.cfg  export_test.exp  export_test.ibd 三个文件传到从服务器上

 在从上:
1. CREATE TABLE `export_test` (
  `a` int(11) DEFAULT NULL
) ENGINE=InnoDB;

2. alter table test.export_test discard tablespace;

3.把export_test.cfg  export_test.exp  export_test.ibd 三个文件拷贝到test 数据文件目录下,并修改权限为chown -R mysq.mysql export_test.*

4.alter table test.export_test import  tablespace;

5.select  * from  test.export_test 发现数据已经存在。
阅读(2498) | 评论(0) | 转发(0) |
0

上一篇:maridb的audit插件

下一篇:没有了

给主人留下些什么吧!~~