mysql 8.0 以上链接数据库

报错内容:

### Error querying database.  Cause: 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.
### The error may exist in mappers/UserMapper.xml
### The error may involve com.jql.mybatis.mapper.UserMapper.getUser
### The error occurred while executing a query
### Cause: 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.

解决办法:
在链接url后面添加?serverTimezone=UTC
在这里插入图片描述
注意:
1.UTC一定要大写
2.mysql 8.0 以后的版本 driver 驱动变化

猜你喜欢

转载自blog.csdn.net/weixin_43727535/article/details/107471671
今日推荐