Hibernate: Create Mysql InnoDB tables instead of MyISAM
Can't you specify the Hibernate dialect and use
From MySQL version > 5.1 this should be
to avoid running into this issue Using "TYPE = InnoDB" in MySQL throws exception
Go to this link:
It clearly says :
Traditionally, MySQL used the non-transactional MyISAM storage engine, and this is the default storage engine for all Dialects that are older than MySQL55Dialect. From MySQL55Dialect onwards, the InnoDB storage engine is used by default.
Put the following in your application.properties (or in your config):
Notice 55 in above. - not just 5.
And you can see it in the console too:
Hibernate: create table users_events (user_id bigint not null, event_id bigint not null) engine=InnoDB Hibernate: create table users_roles (user_id bigint not null, role_id bigint not null) engine=InnoDB
Hope it helps.
Are you specifying the dialect setting in your hibernate configuration? If not, then Hibernate will attempt to auto-detect the database dialect, and will choose the safest MySQL dialec, which is MySQL 4 MyISAM.
You can give it a specific dialect, by adding this to your hibernate properties: