zoukankan      html  css  js  c++  java
  • Springboot2.0中jpa默认创建的mysql表为myisam引擎问题

    使用Springboot2.0后,使用jpa操作mysql数据库时,默认创建的表的引擎是myisam,myisam是不能加外键的,找了一些资源,最终可以用此方法解决!

    yml格式:

    spring:
      jpa:
        database: mysql
        show-sql: true
        hibernate:
          ddl-auto: update
          naming:
            physical-strategy: org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy
        database-platform: org.hibernate.dialect.MySQL5InnoDBDialect  #不加这句则默认为myisam引擎

    properties格式:

    spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL55Dialect
  • 相关阅读:
    菜根谭#69
    菜根谭#68
    菜根谭#67
    菜根谭#66
    菜根谭#65
    菜根谭#64
    菜根谭#63
    更新centos本地仓库(换源)
    docker初探
    centos python版本升级到3.x
  • 原文地址:https://www.cnblogs.com/WPF0414/p/9885615.html
Copyright © 2011-2022 走看看