SpringData+JPA+mysql 8, cannot be null when 'hibernate.dialect' not set

SpringData+JPA+mysql 8, 报错 cannot be null when 'hibernate.dialect' not set


Because Hibernate SQL dialect is not set lead, and add the following line in the properties file:

spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect

spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect

If you use mysql6 above, may continue error

Because of time zone problems caused by version, using the 5.7 or less are not being given,

Solution:

To configure the database url address "serverTimezone = UTC"

MySQL jdbc version 6.0 or later must be configured "serverTimezone" parameter

          On behalf of UTC is Universal Time

          If we use the time is Beijing time zone is east eight districts, leading UTC eight hours. url time zone using China Standard Time. Also on serverTimezone = Asia / Shanghai

url addition serverTimezone = Asia / Shanghai

Hibernate SQL dialect in the following table:

Published 153 original articles · won praise 6 · views 2362

Guess you like

Origin blog.csdn.net/yangshengwei230612/article/details/103728431