Change a MySQL Table from MyISAM to InnoDB

From gnuru.org

If you want to use proper database features in mysql – the sort that Postgresql has as standard – you need to use the InnoDB storage engine rather than the default MyISAM.

To see what sort of storage engine your tables are currently using do this in the mysql shell:
SELECT TABLE_NAME, ENGINE FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'test';

Replace ‘test’ with the name of your database. Then, to convert the table to the InnoDB engine, do this:
alter table tablename ENGINE = InnoDB;

Replace ‘tablename’ with the name of the table you want to convert.

Hat tip: here and here.

g33kadmin

I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....