java SpringBoot常见错误处理

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'XXX.hibernate_sequence' doesn't exist

如果使用的是msyql数据库,在数据表实体类中,对于自增主键需要设置自增规则为@GeneratedValue(strategy=GenerationType.IDENTITY)

参考文章:

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'portal.hibernate_sequence' doesn't exist, 谈谈主键自增的方式
Spring Data JPA踩坑(@id @GeneratedValue)

Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.TransactionException: JDBC begin transaction failed:

application.yml 数据库连接url中加入 &autoReconnect=true&failOverReadOnly=false

参考文章:

tomcat运行一段时间后报Could not open JPA EntityManager for transac

你可能感兴趣的:(java SpringBoot常见错误处理)