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

jdbc:mysql://localhost:3306/yinyousentence

改成

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

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

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

SQLException: The server time zone value