You must configure either the server or JDBC driver (via the serverTimezone configuration property)

You must configure either the server or JDBC driver (via the serverTimezone configuration property),第1张

You must configure either the server or JDBC driver (via the serverTimezone configuration property)

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

spring:
  datasource: #配置datasource
    username: root
    password: 123456
    driverClassName: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql:///blog?serverTimezone=UTC
    type: com.alibaba.druid.pool.DruidDataSource   #使用那个连接池

学习java的,可以关注公众号,可以免费获取毕业设计项目、各种免费软件、资料,笔记哦。


 

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5683926.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存