2

I'm using spring-boot-2.0.3 with hibernate and would like to use database table auto generation.

Problem: by default myisam tables are created, but I'd prefer innodb. Adding the following properties work to change the tables always to innodb, but which of those properties should be the preferred way?

spring.jpa.properties.hibernate.dialect.storage_engine=innodb
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL57Dialect

Is there any drawback using one over the other?

Sidenote: this is NOT a duplicate (the linked question is in no way about java/hibernate/spring)!

membersound
  • 81,582
  • 193
  • 585
  • 1,120
  • Possible duplicate of [How to make innodb as default engine](https://stackoverflow.com/questions/4199446/how-to-make-innodb-as-default-engine) – Karol Dowbecki Jul 26 '18 at 15:02
  • 1
    You need both so there isn't a preferred way as both are necessary. Although I believe that as of MySQL 5.5 the default storage switched to InnoDB. Which will be switched if you use an older MySQL dialect from hibernate. – M. Deinum Jul 26 '18 at 17:08
  • Using `MySQL57Dialect` has other advantages than just specifying the storage engine... – Mark Rotteveel Jul 29 '18 at 14:26

0 Answers0