美文网首页
Spring Boot 03 -- JDBC中The serve

Spring Boot 03 -- JDBC中The serve

作者: 半碗鱼汤 | 来源:发表于2019-08-15 16:29 被阅读0次

在JDBC使用的时候有时候会出现java.sql.SQLException: The server time zone value '???ú±ê×??±??' is unrecognized or represents........的错误,具体错误如下:


解决方案:
在jdbc连接的url后面加上serverTimezone=GMT即可解决问题,如果需要使用gmt+8时区,需要写成GMT%2B8
如:

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

相关文章

网友评论

      本文标题:Spring Boot 03 -- JDBC中The serve

      本文链接:https://www.haomeiwen.com/subject/rqnzjctx.html