java.sql.SQLException: The server time zone value ‘�й���׼ʱ��‘ is unrecognized or represents more tha_com.dao.userdao.getbyid-程序员宅基地

技术标签: MySQL  

maven +springboot + mybatis 项目 连接数据库报错

测试数据库连接报错

后台报错信息如下:↓↓↓↓

java.sql.SQLException:The server time zone value ‘�й���׼ʱ��’ is unrecognized or represents more than onetime zone. You must configure either the server or JDBC driver (via theserverTimezone configuration property) to use a more specifc time zone value ifyou want to utilize time zone support.

Causedby: com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: Theserver time zone value ‘�й���׼ʱ��’ is unrecognized or representsmore than one time zone. You must configure either the server or JDBC driver(via the serverTimezone configuration property) to use a more specifc time zonevalue if you want to utilize time zone support.

2018-03-3114:02:27.367 ERROR 4844 — [nio-8080-exec-3]o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path[] threw exception [Request processing failed; nested exception isorg.mybatis.spring.MyBatisSystemException: nested exception isorg.apache.ibatis.exceptions.PersistenceException:

Errorquerying database. Cause:org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBCConnection; nested exception is java.sql.SQLException: The server time zonevalue ‘�й���׼ʱ��’ is unrecognized or representsmore than one time zone. You must configure either the server or JDBC driver(via the serverTimezone configuration property) to use a more specifc time zonevalue if you want to utilize time zone support.

Theerror may exist in com/fanzs/secondskill/dao/UserDao.java (best guess)

Theerror may involve com.fanzs.secondskill.dao.UserDao.getById

Theerror occurred while executing a query

###Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not getJDBC Connection; nested exception is java.sql.SQLException: The server timezone value ‘�й���׼ʱ��’ is unrecognized or representsmore than one time zone. You must configure either the server or JDBC driver(via the serverTimezone configuration property) to use a more specifc time zonevalue if you want to utilize time zone support.] with root cause

com.mysql.cj.core.exceptions.InvalidConnectionAttributeException:The server time zone value ‘�й���׼ʱ��’ is unrecognized or represents more than onetime zone. You must configure either the server or JDBC driver (via theserverTimezone configuration property) to use a more specifc time zone value ifyou want to utilize time zone support.

解决办法

              修改配置文件 application.properties

错误的

spring.datasource.url=jdbc:mysql://localhost:3306/secondskill?useUnicode=true&characterEncoding=UTF-8
修改为↓↓↓↓
spring.datasource.url=jdbc:mysql://localhost:3306/secondskill?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/qq_44646761/article/details/108438087

智能推荐

重装win7后如何恢复ubuntu引导_ubuntu怎么重装wind7-程序员宅基地

文章浏览阅读2.5k次。如果电脑之前装了ubuntu,后来又重装了win7,结果发现ubuntu的启动项不见了,是因为重装windows7后,安装系统将把MBR重写,所以安装完成后就会直接进入windows7而不再出现grub2的系统选择界面了。如果您遇到这种情况,完全不需要再把ubuntu重装,因为 ubuntu并未被破坏,只是少了一道通往ubuntu的“门”而已。我们现在就要设法重建一道这样的“门”。修复的方_ubuntu怎么重装wind7

openlayers单击弹出属性对话框_openlayers添加属性框-程序员宅基地

文章浏览阅读814次。<!DOCTYPE html><html> <head> <meta charset="utf-8"> <title>Using Parcel with OpenLayers</title> <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script> <link rel="styleshe..._openlayers添加属性框

计算机类核心期刊-程序员宅基地

文章浏览阅读204次。计算机类核心期刊

SAP MM Product Hierarchy的配置_sap product hierarchy-程序员宅基地

文章浏览阅读4.9k次。笔者所在的D项目里,因业务需要启用Product Hierarchy, 业务提交了其设计的Product Hierarchy结构图给我, 让我帮忙在系统里设置好。 因SAP系统标准的产品层次是三层,每个层次的代码的长度分别是5,5,8。 用户提出的产品层次目前只有三层,每个层次代码长度是3。这个设计与标准SAP的产品层次代码长度不同。是故需要在配置里,设置产品层次的层次,..._sap product hierarchy

多亏了这篇文章,我的开发效率远远领先于我的同事-程序员宅基地

文章浏览阅读218次。欢迎大家前往腾讯云+社区,获取更多腾讯海量技术实践干货哦~ 本文由独木桥先生发表于云+社区专栏介绍如果您有从Linux服务器上的源代码安装软件的经验,您可能会遇到make实用程序。该工具主要用于自动编译和构建程序。它允许应用程序的作者轻松地布置构建该特定项目所需的步骤。尽管make是为自动化软件编译而创建的,但该工具的设计灵活性足以使其可以自动执行几乎任何可以从命令行完成...

用图像生成视频流出现的问题 Failed to load OpenH264 library_failed to load openh264 library: openh264-1.8.0-wi-程序员宅基地

文章浏览阅读3k次。1、报以下错误> Failed to load OpenH264 library: openh264-1.8.0-win64.dll Please> check environment and/or download library:> https://github.com/cisco/openh264/releases> > [libopenh264 @ 00000212dce9a000] Incorrect library version loaded>_failed to load openh264 library: openh264-1.8.0-win64.dll

随便推点

【Unity3D】项目架构设计与开发管理_unity系统的架构-程序员宅基地

文章浏览阅读4.6k次。Unity项目架构设计与开发管理笔者是观摩刘钢先生讲解的Unity项目架构设计与开发管理后所总结记录的。_unity系统的架构

RPA学习天地——RPA厂商小揭秘艺赛旗_艺赛旗 团队情况-程序员宅基地

文章浏览阅读216次。学RPA,考RPA,用RPA尽在RPA学习天地一、关于创始团队和基本介绍: “I”公司成立于2011年,创始团队的核心成员来自于安氏安全。因此,”I”公司是做安全起家的,早期的客户主要是上海本地大型企业的安全业务,如移动、太保等,正因为这些客户的原始积累,给”I”公司后期的RPA产品,提供了落地的基础。 早先“I”公司宣称是国内第一家RPA公司,后来改为国内最早RPA企业之一。可以说“I”公司是国内RPA行业值得尊敬的前辈企业。 ”I”公司总部位于上海,研发中心位于南京,在北京、广州,深圳设立了分支机构_艺赛旗 团队情况

css的line-height:1.5,line-height:150%,line-height:1.5em,line-height:15px的区别-程序员宅基地

文章浏览阅读2.7k次。看到一道面试题据说是最基础的东西,但是发现我还是不太清楚(css会用但是太细节的真心记不住)下面就在博客上记录一下:首先要说一下line-height在api中的语法是:line-height:normal | || ;line-height:主要是设计元素的行高,我们现在这里假设font-size:24px;1.首先是px的,设置行高是15px的话,那么我们得到的行高自然_1.5em

无法启动此程序,因为计算机中丢失VCRUNTIME140.dll 尝试重新安装此程序以解决此问题_因为计算机中丢失 vcruntime140.dll。尝试重新安装该程序以解决此问题。-程序员宅基地

文章浏览阅读3.3k次。当时因为要把程序打包运用到另一台大液晶屏幕上,用的是vs2015编译器,然后双击运行时,出现无法启动此程序,因为计算机中丢失VCRUNTIME140.dll 尝试重新安装此程序以解决此问题.网上参考了这两位大神解决方法。https://www.cnblogs.com/xinjianheyi/p/6795786.htmlhttps://blog.csdn.net/lh87270202/arti..._因为计算机中丢失 vcruntime140.dll。尝试重新安装该程序以解决此问题。

Plato Farm通过LaaS协议Elephant Swap,为社区用户带来全新体验-程序员宅基地

文章浏览阅读109次。将成为刚需,因为大家都需要ePLATO来进一步解锁ePLATO.而在ElephantSwap。资产,我们需要在ElephantSwap中进行交易行为来解锁ePLATO.ePLATO。投资回报,据悉在PLATO代coin上线ElephantSwap后,将能够为投资。在PLATO上线ElephantSwap后,任何持有PLATO。而在PLATO上线ElephantSwap后,ePLATO。比如PLATO,需要将其在ElephantSwap中进行。...

saltstack进行文件管理_saltstack cp.get_file sls-程序员宅基地

文章浏览阅读1.2k次。方法一:写sls模板去实现实践:对于salt我们尤其要注意的就是缩进,这是python的特点2.配置Saltstack master1)编辑/etc/salt/master, 取掉下面注释行,目录/srv/salt是Saltstack核心配置文件目录。file_roots:base: - /srv/salt/2)查看我规划的Saltstack .sls和配置..._saltstack cp.get_file sls

推荐文章

热门文章

相关标签