MySQL数据库报Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException

错误是

Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: 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.
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:488)

问题:数据库时间问题

解决:加上serverTimezone=UTC即可

url: jdbc:mysql://localhost:3306/blogserverTimezone=UTC&useUnicode=true&characterEncoding=utf-8

猜你喜欢

转载自blog.csdn.net/realize_dream/article/details/105483894