请问如何在 Spring Boot 2.0.x 中配置“hibernate.dialect.storage_engine = innodb”属性?
- Spring Boot 2.0.5.RELEASE
- MySQL 社区服务器 8.0.11
应用程序属性:
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 服务器变量:
default_storage_engine=InnoDB
default_tmp_storage_engine=InnoDB
Spring Boot 控制台输出:
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
最佳答案
你应该使用 spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
关于mysql - Spring Boot 2.0.x 上的 InnoDB?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52580809/