JDBC获取连接Mysql时的时区错误问题:

报错显示:
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.
解决方法:
1.使用root用户登录mysl(Dos或者MySQL Workbench)
2.输入sql语句(show variables like ‘%time_zone%’;)查询当前的时区配置,如图:
JDBC获取连接Mysql时的时区错误问题)
3.输入sql修改时区(set global time_zone=’+8:00’;)ps:我们为北京时间东八区。如图:
JDBC获取连接Mysql时的时区错误问题

4.Dos下的解决,如图:
JDBC获取连接Mysql时的时区错误问题

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-30
  • 2022-01-23
  • 2020-01-19
  • 2022-12-23
  • 2021-09-02
猜你喜欢
  • 2022-12-23
  • 2021-05-12
  • 2021-09-08
  • 2021-12-05
  • 2022-12-23
  • 2021-11-30
相关资源
相似解决方案