zoukankan      html  css  js  c++  java
  • 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

    启动springboot就报错

    Error querying database.  Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: Access denied for user ''@'localhost' (using password: YES)

    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.
    这是因为 servertime=UTC导致时间差8个小时(MySQL jdbc 6.0 版本以上必须配置此参数)

    UTC代表的是全球标准时间 ,但是我们使用的时间是北京时区也就是东八区,领先UTC八个小时。

    UTC + (+0800) = 本地(北京)时间

    而我们的配置文件application.yml中的url用的是北京时间。所以会报错。

    更改前的application.yml相关配置信息:

    更改方案:

    在url后面加上这个就可以了

    1 &serverTimezone=UTC 代表全球标准时间 
    2 serverTimezone=Asia/Shanghai 代表中国的时间,建议用这个,这样写入和读取时间一致。
    &useSSL=false 这个是url是否拼接,选择false就行了 

     访问成功如下:

     愿可以帮到你.........

  • 相关阅读:
    vue-cli element axios sass 安装
    Rem-- ui图与适配手机的px换算
    REM
    Canvas画半圆扇形统计图
    在vue中安装SASS
    在vue中引用.SCSS的公用文件
    Echart--折线图手柄触发事件
    vue 脚手架webpack打包后,解决能看到vue源码的问题
    js 函数 /变量/ 以及函数中形参的预解析的顺序
    【算法日记】4.递归和快速排序
  • 原文地址:https://www.cnblogs.com/Sarah-Strawberry/p/11089383.html
Copyright © 2011-2022 走看看