MySQL: How to change or convert MyISAM to InnoDB or vice versa?

by Yang Yang on September 2, 2009

Share This Article:
Subscribe to Kavoir: blog feed

After we have discussed the advantages and disadvantages of MyISAM and InnoDB, you might want to convert them back and forth and see the performance differences yourself. For small website, the difference may be minor but for a large popular application,

  • MyISAM tables yield better performance results in selecting data records
  • InnoDB tables give better performance results in inserting and updating data records

To change a MyISAM table to an InnoDB table:

ALTER TABLE table_name ENGINE = InnoDB;

To convert an InnoDB table to a MyISAM table:

ALTER TABLE table_name ENGINE = MyISAM;
Share This Article:
Subscribe to Kavoir: blog feed

You should also read:

{ 6 comments… read them below or add one }

Will Fastie October 24, 2009 at 9:48 pm

According to the MySQL documentaion at http://dev.mysql.com/doc/refman/5.0/en/innodb-restrictions.html, converting from MyISAM to InnoDB is an “unsupported operation.”

Reply

Yang Yang January 26, 2010 at 1:37 pm

Yeah, we’ll see about that.

Reply

Drew November 9, 2009 at 2:51 am

Hi Will,

According to the docs that limitation/safeguard/whatever is only for “system” tables “(such as user or host).”

http://dev.mysql.com/doc/refman/5.0/en/converting-tables-to-innodb.html

Reply

Yang Yang February 26, 2010 at 6:15 pm

Thanks for the tip, Drew.

Reply

Matt Brotherson January 13, 2011 at 5:31 am

Cheers for the post. Worked perfectly!

Reply

Sinan E. November 19, 2011 at 12:25 am

Thanks.

Reply

Leave a Comment

{ 2 trackbacks }

Previous post:

Next post: