簡體   English   中英

如何在 jpa 中創建表作為 InnoDB?

[英]How to create tables as InnoDB in jpa?

我試圖將表創建為 innodb 以使用外鍵,但我失敗了,我的表仍然是 myIssam 引擎!

我的 mysql 版本是 5.7.26,這是我的 application.properties

spring.datasource.url=jdbc:mysql://localhost:3306/general_security?useUnicode=true&characterEncoding=UTF-8&useLegacyDatetimeCode=false&serverTimezone=UTC
spring.datasource.username=basil
spring.datasource.password=root
spring.jpa.properties.hibernate.show_sql=true
spring.jpa.properties.hibernate.use_sql_comments=true
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.properties.hibernate.type=debug
spring.jpa.hibernate.ddl-auto=create
hibernate.dialect.storage_engine=innodb
hibernate.dialect=org.hibernate.dialect.MySQL5Dialect

spring.datasource.hikari.maximum-pool-size=50

server.servlet.context-path=/generalSecurity
spring.jmx.default-domain: general_security

我也試過

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

你可以試試

spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL57Dialect
spring.jpa.properties.hibernate.dialect.storage_engine=innodb

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM