java ee 中连接数据库出现的一些异常与问题总结

 一、The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one(数据库时区异常)

解决方案

【1】在调用的url地址后添加    ?serverTimezone=GMT%2B8

例如:<param-value>    jdbc:mysql://localhost:3306/javaee?serverTimezone=GMT%2B8     </param-value>

并且需要把连接池内的url地址修改成如上。

【2】设置整个数据库的市区。语句如下:

show variables like '%time_zone%'

set global time_zone='+8:00';

——————————————————————————————————————————————————————

 

猜你喜欢

转载自www.cnblogs.com/Mr-Sulin/p/9649220.html