美文网首页
Spring Boot +Jpa 报 Specified key

Spring Boot +Jpa 报 Specified key

作者: Suncy | 来源:发表于2019-10-12 09:40 被阅读0次

原因:

Spring boot 2.x默认使用的mysql 引擎为myisam,但是Spring boot2.0之前使用的是InnoDB,Spring boot2.0之后默认使用的是myisam引擎。然后在新建表的时候。就出这个错了

解决:

在项目配置文件中加如下配置:
spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
再将数据库原来的数据表全部删除,重启项目即可。
图片.png

相关文章

网友评论

      本文标题:Spring Boot +Jpa 报 Specified key

      本文链接:https://www.haomeiwen.com/subject/lzgfmctx.html