关于JDBC jar包时区错误导致的连接失败

报错信息:
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.

意思是说:
服务器的时区价值”?й? ? ? ? ? ? ?未被识别或代表多个时区。如果您想利用时区支持,您必须配置服务器或JDBC驱动程序(通过“serverTimezone”配置属性)来使用更特殊的时区值。

就是说是因为数据库时区与系统时区有差异导致的
怎么解决呢?
在url后部加上serverTimezone=UTC
如下

jdbc:mysql://localhost:3306/course?serverTimezone=UTC
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章