问题
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