异常Caused by: com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: The ser

这是我刚刚步入Mybatis第一个入门程序出现的错误:

在这里插入图片描述
错误的全名:
Caused by: com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: 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.

解决方案:
首先检查我们的配置文件链接数据库的url是否错误:
8.0以下的正确写法是:com.mysql.jdbc.Driver
8.0以上的正确写法是:com.mysql.cj.jdbc.Driver
如果这样不行在后面加上:
?serverTimezone=UTC 或者 ?serverTimezone=GMT
这两句的任意一句试试。
在这里插入图片描述
然后就查询出来了
在这里插入图片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章