The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more ....

版权声明:转发请标明出处,谢谢! https://blog.csdn.net/Myuhua/article/details/84961053

报错信息: 

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.

错误原因:mysql的时区错误

解决方法:在url末尾加上serverTimezone=UTC,UTC是统一标准世界时间。

 jdbc:mysql://localhost:3306/test?&useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=UTC

猜你喜欢

转载自blog.csdn.net/Myuhua/article/details/84961053