views:

35

answers:

4

I would like to copy data from an existing table say table1 to a new table table2. The tables' engines are different. I mean, the existing table uses MyISAM and the new one uses Innodb.

+2  A: 

INSERT INTO newtable SELECT * FROM oldtable;

INSERT SELECT

Naktibalda
This won't work with different engines.
Josaph
why? I don't see any reason.
Naktibalda
the engines are irrelevant, it will work. you can even setup replication to different engines.
Brent Baisley
A: 

insert into NewTable (col1, col2, col3) select col1, col2, col3 from OldTable

Tim Coker
A: 

Another MyISAM to InnoDB article. http://www.linux.com/archive/feed/46370

Josaph