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
全部评论

相关推荐

StephenZ_:我9月份找的第一段实习也是遇到这种骗子公司了,问他后端有多少人和我说7个正职,进去一看只有一个后端剩下的都是产品前端算法(没错甚至还有算法)。还是某制造业中大厂,我离职的时候还阴阳怪气我
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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