mysql 迁移表空间_MYSQL表空间迁移

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入 32.ERROR 1031 (HY000): Table storage engine for 'city' doesn't havethis option 33.mysql alter table cityengine=innodb; 34.mysql flush table cityfor export; --对表加锁。 35.Query OK, 0 r

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入

32.ERROR 1031 (HY000): Table storage engine for 'city' doesn't havethis option

33.mysql> alter table cityengine=innodb;

34.mysql> flush table cityfor export; --对表加锁。

35.Query OK, 0 rows affected (0.18 sec)

36.

复制表文件到目标位置

C:\ProgramData\MySQL\MySQL Server 5.6\data\world>mkdir city

C:\ProgramData\MySQL\MySQL Server 5.6\data\world>copy city.* city

city.cfg

city.frm

city.ibd

3 file(s) copied.

C:\ProgramData\MySQL\MySQL Server 5.6\data\world>cd city

C:\ProgramData\MySQL\MySQL Server 5.6\data\world\city>dir

Volume in drive C has no label.

Volume Serial Number is D0FA-F7A0

Directory of C:\ProgramData\MySQL\MySQL Server 5.6\data\world\city

10/10/2013 10:58 AM.

10/10/2013 10:58 AM..

10/10/2013 10:53 AM 582 city.cfg

10/10/2013 10:53 AM 8,710 city.frm

10/10/2013 10:53 AM 475,136 city.ibd

3 File(s) 484,428 bytes

2 Dir(s) 224,676,024,320 bytes free

在目标库上删除可能存在的同名表空间。

mysql> unlock tables;--释放锁。

2. Query OK, 0 rowsaffected (0.07 sec)

3. mysql> alter table city discard tablespace;删除可能存在的同名表空间

4. Query OK, 0 rowsaffected (0.23 sec)

5. mysql> selectcount(*) from city;

6. ERROR 1814 (HY000):Tablespace has been discarded for table 'city'

7. mysql> alter tablecity import tablespace;

8. ERROR 1146 (42S02):Table 'world.city' doesn't exist

9. C:\ProgramData\MySQL\MySQLServer 5.6\data\world\city>copy city.* ..

10.city.cfg

11.city.frm

12.Overwrite ..\city.frm? (Yes/No/All): yes

13.Access is denied.

14.city.ibd

15. 2 file(s) copied.

16.C:\ProgramData\MySQL\MySQL Server 5.6\data\world\city>

17.mysql> alter table city import tablespace;

18.Query OK, 0 rows affected (0.94 sec)

19.mysql> select count(*) from city;

20.+----------+

21.| count(*) |

22.+----------+

23.| 4079 |

24.+----------+

25.1 row in set (0.08 sec)

表空间被成功。

[1] [2]

test.jsp?url=http%3A%2F%2Fwww.chinaitlab.com%2Fcms%2Fimages%2Flogo14.gif&refer=http%3A%2F%2FLinux.chinaitlab.com%2FMYSQL%2F942218_2.html

f68f2add0b68e4f9810432fce46917b7.png

本文原创发布php中文网,转载请注明出处,感谢您的尊重!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值