Search code examples
springhibernatespring-boot

Setting Hibernate Dialect not working with Spring and YML config


this is my config:

spring.jpa:
  hibernate:
    ddl-auto: update
    connection:
      charset: utf8
      useUnicode: true
  properties.hibernate.dialect: org.hibernate.dialect.MySQL5InnoDBDialect

Based on what I found in docs and SO it should work but still new tables are create with MyISAM instead of InnoDB.

What is wrong in my config?


Solution

  • The property for setting the dialect is actually spring.jpa.properties.hibernate.dialect

    Try this:

    spring.jpa: 
      hibernate: 
        connection: 
          charset: utf8
          useUnicode: true
        ddl-auto: update
      properties.hibernate.dialect: org.hibernate.dialect.MySQL5InnoDBDialect
    

    Spring boot sample for reference