InnoDB on Spring Boot 2.0.x?

杀马特。学长 韩版系。学妹 提交于 2021-01-29 02:43:16

问题


How to configure the "hibernate.dialect.storage_engine = innodb" property in Spring Boot 2.0.x, please ?

  • Spring Boot 2.0.5.RELEASE
  • MySQL Community Server 8.0.11

application.properties:

spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.properties.hibernate.dialect.storage_engine=innodb
spring.jpa.show-sql=true

MySQL Server Variables:

default_storage_engine=InnoDB
default_tmp_storage_engine=InnoDB

Spring Boot Console output:

Hibernate: 

    drop table if exists person
Hibernate: 

    create table person (
       id bigint not null auto_increment,
        address varchar(255),
        age integer,
        city varchar(255),
        info varchar(255),
        telephone varchar(255),
        zip_code varchar(255),
        email varchar(255) not null,
        first_name varchar(255) not null,
        last_name varchar(255) not null,
        version bigint,
        primary key (id)
    ) engine=MyISAM

回答1:


You should use spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect




回答2:


You can try this:

spring.jpa.database-platform: org.hibernate.dialect.MySQL5InnoDBDialect


来源:https://stackoverflow.com/questions/52580809/innodb-on-spring-boot-2-0-x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!