Mybatis入门时我出现的错误Caused by: com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: The ser

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

Mybatis入门时我出现的错误Caused by: com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: The ser
错误的全名:
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
这两句的任意一句试试。
Mybatis入门时我出现的错误Caused by: com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: The ser
然后就查询出来了
Mybatis入门时我出现的错误Caused by: com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: The ser