java连接MYSQL80数据库驱动出现java.sql.SQLException:

java.sql.SQLException: The server time zone value ‘???ú±ê×??±??’ is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
解决办法:
你原先的JDBCURL:jdbc:mysql://localhost:3306/mydatabase
在此基础上添加:?serverTimezone=UTC也就是:jdbc:mysql://localhost:3306/mydatabase?serverTimezone=UTC
但如果你的JDBCURL类似下面:

jdbc:mysql://localhost:3306/mydatabase?serverTimezone=UTC&characterEncoding=utf-8

就是有多个params的时候需要以&分开,但&要改为& 如下:

jdbc:mysql://localhost:3306/mydatabase?serverTimezone=UTC&characterEncoding=utf-8
全部评论

相关推荐

不愿透露姓名的神秘牛友
12-17 17:40
点赞 评论 收藏
分享
11-17 23:00
南昌大学 Java
我要娶个什么名:10元一天 0元提成😂
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务