hibernate5.2.2连接mysql的常见错误

版本:hibernate5.2.2.Final

异常提示

1、Caused by: java.sql.SQLException: 
The server time zone value '�й���׼ʱ��' is unrecognized 
or represents more than one time zone.
You must configure either the server or JDBC driver
 (via the serverTimezone configuration property)
 to use a more specifc time zone value 
if you want to utilize time zone support.

解决方法:
在jdbcUrl=jdbc:mysql://localhost:3306/spring
后面加上:

jdbcUrl=jdbc:mysql://localhost:3306/spring?**serverTimezone=UTC**

但如果你的jdbcUrl类似下面:

jdbcUrl=jdbc:mysql://localhost:3306/spring?characterEncoding=utf-8

就是有多个params的时候需要以&分开,如下:

jdbcUrl=jdbc:mysql://localhost:3306/spring?serverTimezone=UTC&characterEncoding=utf-8

你可能感兴趣的:(hibernate5.2.2连接mysql的常见错误)