Chinaunix首页 | 论坛 | 博客
  • 博客访问: 371377
  • 博文数量: 166
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1640
  • 用 户 组: 普通用户
  • 注册时间: 2015-05-05 11:44
个人简介

文章不在长,坚持不懈记录下努力前行的脚步

文章分类

全部博文(166)

文章存档

2017年(19)

2016年(59)

2015年(88)

我的朋友

分类: Mysql/postgreSQL

2015-09-08 18:00:22

1.alter table
it can take a lot of time.MySQL will perform a row-by-row copy of your old table into a new table. During that
time, you’ll probably be using all of the server’s disk I/O capacity, and the original table will be read-locked while the conversion runs
When you convert from one storage engine to another, any storage engine–specific features are lost

2.dump and import
(1)first dump the table to a text file using the mysqldump utility
(2)adjust the CREATE TABLE statement it contains

mysqldump defaults to writing a DROP TABLE command before the CREATE TABLE -- 特别注意


3 create and select
mysql> CREATE TABLE innodb_table LIKE myisam_table;
mysql> ALTER TABLE innodb_table ENGINE=InnoDB;
mysql> INSERT INTO innodb_table SELECT * FROM myisam_table;
percona的pt_online_schema_change工具实现了上述操作的功能;

start transaction;
INSERT INTO innodb_table SELECT * FROM myisam_table where id between x and y;
commit;

阅读(755) | 评论(0) | 转发(0) |
0

上一篇:高性能mysql摘语学习

下一篇:表的导出

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