Hibernate: Create Mysql InnoDB tables instead of MyISAM

David Tinker picture David Tinker · Sep 22, 2009 · Viewed 46.1k times · Source

How can I get Hibernate (using JPA) to create MySQL InnoDB tables (instead of MyISAM)? I have found solutions that will work when using Hibernate to generate an SQL file to create the tables, but nothing that works "on the fly".

Answer

Pascal Thivent picture Pascal Thivent · Sep 22, 2009

Can't you specify the Hibernate dialect and use

hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect

Edit

From MySQL version > 5.1 this should be

hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect

to avoid running into this issue Using "TYPE = InnoDB" in MySQL throws exception