SpringBoot运行报错——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.
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.
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) ~[mysql-connector-java-8.0.16.jar:8.0.16]
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[mysql-connector-java-8.0.16.jar:8.0.16]
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89) ~[mysql-connector-java-8.0.16.jar:8.0.16]
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63) ~[mysql-connector-java-8.0.16.jar:8.0.16]
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73) ~[mysql-connector-java-8.0.16.jar:8.0.16]
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:76) ~[mysql-connector-java-8.0.16.jar:8.0.16]
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:835) ~[mysql-connector-java-8.0.16.jar:8.0.16]
at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:455) ~[mysql-connector-java-8.0.16.jar:8.0.16]
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240) ~[mysql-connector-java-8.0.16.jar:8.0.16]
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199) ~[mysql-connector-java-8.0.16.jar:8.0.16]
at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:149) ~[druid-1.1.9.jar:1.1.9]
at com.alibaba.druid.filter.stat.StatFilter.connection_connect(StatFilter.java:218) ~[druid-1.1.9.jar:1.1.9]
at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:143) ~[druid-1.1.9.jar:1.1.9]
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1515) ~[druid-1.1.9.jar:1.1.9]
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1578) ~[druid-1.1.9.jar:1.1.9]
at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2466) ~[druid-1.1.9.jar:1.1.9]
这是在使用MySQL 8.0以上版本(MySQL连接驱动和版本都是8.0以上)的时候出现的问题错误,我们需要在访问数据库的Url后面加上以下的语句即可:
?serverTimezone=GMT%2B8 1. 比如我一开始的url是
2.
3. jdbc:mysql://localhost:3306/t_book
4. 改成
5. jdbc:mysql://localhost:3306/t_book?serverTimezone=GMT%2B8

上面的这种做法就是扯淡,

我直接改了mysql的version

然后运行就正常了.

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的更多相关文章

  1. 转:java.sql.SQLException: [Microsoft][ODBC 驱动程序管理器] 未发现数据源名称并且未指定默认驱动程序

    在Win7 64位系统下,使用Java+Access数据库编程,用Java连数据库时,出现错误提示,如下: Java java.sql.SQLException: [Microsoft][ODBC 驱 ...

  2. MySQL连接数据库报时区错误:java.sql.SQLException: The server time zone value

    连接MySQL数据库时报以下时区错误信息: java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized ...

  3. 连接mysql数据库报错java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized...解决方法

    今天连接mysql数据库报错如下: java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or r ...

  4. MySql数据库时区异常,java.sql.SQLException: The server time zone value '?й???׼ʱ?' is unrecognized or represents more than one time zone.

    JDBC访问MySql异常 Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException ...

  5. 【JDBC】java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone.

    在使用阿里的druid 时,报了一个异常java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized ...

  6. 解决java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone

    使用spring boot整合MySQL时一直报 java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecog ...

  7. java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ 解决方案

    //第一个异常 Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysq ...

  8. JDBC连接数据库报错:java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone. ......

    问题:Java程序使用JDBC连接MySQL数据库时,控制台报错如下: java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' ...

  9. Exception in thread “main” java.sql.SQLException: The server time zone value ‘�й���׼ʱ��’ is unrecognized or represents more than one time zone.

    Exception in thread “main” java.sql.SQLException: The server time zone value ‘�й���׼ʱ��’ is unrecogn ...

  10. java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized

    Exception in thread "main" java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä ...

随机推荐

  1. AWS 基础设施即代码(五)

    基础设施即代码 概述 手动配置的挑战:可能因为人为错误导致缺乏可靠性,环境无法完全再现,同时需要额外文档 基础设施即代码,是软件开发中用于创建可重用.可维护.可扩展及可测试基础设施的技术.实践和工具, ...

  2. 【C/C++开发】字符串操作

    1)字符串操作 strcpy(p, p1) 复制字符串  strncpy(p, p1, n) 复制指定长度字符串  strcat(p, p1) 附加字符串  strncat(p, p1, n) 附加指 ...

  3. 一个栈的入栈序列为ABCDEF,则不可能的出栈序列是

    技术之瞳 阿里巴巴技术笔试心得习题2.65:  一个栈的入栈序列为ABCDEF,则不可能的出栈序列是(D)  A.DEFCBA B.DCEFBA C.FEDCBA  D.FECDBA E.ABCDEF ...

  4. ROS中的通信机制

    http://www.ros.org/core-components/ Communications Infrastructure At the lowest level, ROS offers a ...

  5. linux 给运行程序指定动态库路径

    1. 连接和运行时库文件搜索路径到设置 库文件在连接(静态库和共享 库)和运行(仅限于使用共享库的程序)时被使用,其搜索路径是在系统中进行设置的.一般 Linux 系统把 /lib 和 /usr/li ...

  6. win10安装Ubuntu,用Xshell连接

    一.安装Ubuntu 安装Ubuntu,安装过程就不详细说了,我是从微软商店下载的Ubuntu安装,没有用VMware,想用Xshell连接Ubuntu,中间一直出问题,现在解决,总结一下. 二.配置 ...

  7. 文件类型分类:头文件dirent.h中定义的文件类型与linux内文件符号对应关系

    头文件 dirent.h 定义了文件类型: enum{    DT_UNKNOWN = 0,         //未知类型    DT_FIFO = 1,            //first in, ...

  8. win10 idea springboot上传镜像到远程docker服务器

    1. 开启2375端口,供外部访问docker vim /usr/lib/systemd/system/docker.service 修改ExecStart为下面一行内容 #ExecStart=/us ...

  9. 谷歌chrome浏览器提示“喔唷 崩溃啦”的解决方案

    原因分析:有可能是注册列表被一些卫士类优化工具或杀毒软件优化了. 解决方案:1. 卸载谷歌浏览器. ①开始→控制面板→添加或删除程序→找到谷歌浏览器卸载(卸载时勾选删除数据) ② 进入注册列表删除谷歌 ...

  10. [LOJ 6485]LJJ学二项式定理(单位根反演)

    也许更好的阅读体验 \(\mathcal{Description}\) 原题链接 \(T\)组询问,每次给\(n,s,a_0,a_1,a_2,a_3\)求 \(\begin{aligned}\left ...