SQLException: The server time zone value '�й���׼ʱ��' is unrecognized

spring中配置hibernate出现该问题,网上说了,原因是因为使用的mysql连接库版本太高的原因,网上给出的改法为:
dataSource中的

jdbc:mysql://localhost:3306/yinyousentence

改成

jdbc:mysql://localhost:3306/yinyousentence?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&aserverTimezone=UTC

如果是一般的项目,这么改就可以了,但是对于配置在spring里的hibernate来说,这么配并不完全清晰和准确。

下面一张图讲清楚解决办法,一定要记得把&改成&,不然会报一个别的错。

这里写图片描述

猜你喜欢

转载自blog.csdn.net/qq_32623363/article/details/80922704