简体   繁体   中英

How to create tables as InnoDB in jpa?

Im trying to create tables as innodb in order to use foreign keys but i got failed my tables are staying as myIssam engine!

My mysql version is 5.7.26 and here is my 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

i also tried

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

You could try

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM