错误提示:
Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is 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.

解决办法;

在连接字符串后面加上?serverTimezone=UTC

其中UTC是统一标准世界时间。

完整的连接字符串示例:jdbc:mysql://localhost:3306/dwkj?serverTimezone=UTC

另一种选择:jdbc:mysql://localhost:3306/dwkj?useUnicode=true&characterEncoding=UTF-8,这个是解决中文乱码输入问题

最好结合使用

jdbc:mysql://localhost:3306/dwkj?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF-8

其中UTC是统一标准世界时间。

完整的连接字符串示例:jdbc:mysql://localhost:3306/dwkj?serverTimezone=UTC

另一种选择:jdbc:mysql://localhost:3306/dwkj?useUnicode=true&characterEncoding=UTF-8,这个是解决中文乱码输入问题

最好结合使用

jdbc:mysql://localhost:3306/dwkj?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF-8

相关文章:

  • 2021-10-20
  • 2022-01-29
  • 2021-10-16
  • 2022-01-31
  • 2022-12-23
  • 2022-01-13
  • 2022-02-15
  • 2021-08-05
猜你喜欢
  • 2021-07-08
  • 2021-04-17
  • 2021-10-15
  • 2021-11-17
  • 2022-01-14
  • 2021-10-30
  • 2021-11-05
相关资源
相似解决方案