mysql - Spring Boot 2.0.x 上的 InnoDB?

标签 mysql spring-boot innodb

请问如何在 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/

相关文章:

php - Mysql 插入不起作用并且没有给出错误

mysql - 在mysql中插入unix时间戳

php - 加入两个表并显示不同的列列表

java - Spring-Data Jpa 继承 : Keeping Entity Id's in Children Entity

python - 更改 my.cnf 文件中的 innodb_page_size 不会重新启动 mysql 数据库

mysql - 从外部主机获取动态数据 - 建立 mysql 连接或通过curl获取数据?

Java WebSocket 客户端 Spring boot

java - 无法模拟服务以使其抛出异常

MySQL 行大小太大

mysql 更改 innodb_large_prefix