阅读:1785回复:0
[Java EE]使用JDBC连接MySql时报错:You must configure either the server or JDBC driver (via the serverTimezone cconfig
问题:在springboot 中,使用了datasource对象后,报如下错误:
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. 解决方案: 在配置文件中的 连接字符串后面加上?serverTimezone=UTC UTC是统一标准世界时间 完整的连接字符串示例:jdbc:mysql://localhost:3306/hello?serverTimezone=UTC 如果指定使用gmt+8时区,需要写成GMT%2B8,否则可能报解析为空的错误 参考:https://blog.csdn.net/weixin_42652696/article/details/83864740/ |
|
|