JDBC的The server time zone value '???ú±ê×??±??' is unrecognized or represents

在spring中,在JDBC使用的时候有时候会出现java.sql.SQLException: The server time zone value ‘???ú±ê×??±??’ is unrecognized or represents…的错误。
现这个的原因是因为 mysql返回的时间总是有问题,比实际时间要早8小时。
解决:

jdbc:mysql://localhost:3306/jdbc01?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8

猜你喜欢

转载自blog.csdn.net/qq_34866380/article/details/82779817