连接mysql一直报时区错误,跟着网上改了很多都没用?请问老师怎么解决啊?
来源:2-4 代码关联Git远程仓库

pandaBgc
2021-03-06
Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.4.0:generate (default-cli) on project wiki: 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 specific time zone value if you want to utilize time zone support.
3回答
-
pandaBgc
提问者
2021-03-06
哇哇哇,同学们,我解决了,我在application.properties中像这样改了一下,真的是要哭了~~
spring.datasource.url=jdbc:mysql://localhost:3306/wiki?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8
spring.datasource.username=你的username
spring.datasource.password=你的password
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
mybatis.mapper-locations=classpath:/mapper/**/*.xml
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
spring.jackson.time-zone=GMT+8012021-03-06 -
pandaBgc
提问者
2021-03-06
在cmd查看时间是对的,但是mybatis一做数据库查询就是比现在的时间少8小时,我试过cmd中修改时区和mysql中配置文件修改时区,但是现在还是报错。。。像下面这样,哭了!
00 -
普粹
2021-03-06
我的是这样设置就不报错了
012021-03-06
相似问题