mysql数据库The server time zone value '�й���׼ʱ��' is unrecogni等报错解决_美少女降临人世间的博客-程序员ITS203

技术标签: MySql学习  SpringBoot学习  The server time zone value '�й���׼ʱ  MyBatis学习  Mysql报错解决  

MySQL连接报错

spring.datasource.url连接信息出问题。

报错信息

{
  "timestamp": "2019-11-12T11:07:30.870+0000",
  "status": 500,
  "error": "Internal Server Error",
  "message": "nested exception is org.apache.ibatis.exceptions.PersistenceException: \r\n### Error querying database.  Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.\r\n### The error may exist in file [E:\\eclipse\\workspace\\cms_jd1911\\target\\classes\\mapper\\UserMapper.xml]\r\n### The error may involve com.briup.dao.UserMapper.selectByExample\r\n### The error occurred while executing a query\r\n### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.",
  "trace": "org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: \r\n### Error querying database.  Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.\r\n### The error may exist in file [E:\\eclipse\\workspace\\cms_jd1911\\target\\classes\\mapper\\UserMapper.xml]\r\n### The error may involve com.briup.dao.UserMapper.selectByExample\r\n### The error occurred while executing a query\r\n### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.\r\n\tat org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:92)\r\n\tat org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:440)\r\n\tat com.sun.proxy.$Proxy75.selectList(Unknown Source)\r\n\tat org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:223)\r\n\tat org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:147)\r\n\tat org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:80)\r\n\tat org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:93)\r\n\tat com.sun.proxy.$Proxy76.selectByExample(Unknown Source)\r\n\tat com.briup.service.impl.UserImpl.findAll(UserImpl.java:30)\r\n\tat com.briup.web.controller.TestController.findAll(TestController.java:28)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\r\n\tat java.lang.reflect.Method.invoke(Unknown Source)\r\n\tat org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)\r\n\tat org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)\r\n\tat org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106)\r\n\tat org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:888)\r\n\tat org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793)\r\n\tat org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)\r\n\tat org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)\r\n\tat org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)\r\n\tat org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)\r\n\tat org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)\r\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:634)\r\n\tat org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)\r\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:741)\r\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)\r\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n\tat org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)\r\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n\tat org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)\r\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\r\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n\tat org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)\r\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\r\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n\tat org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)\r\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\r\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n\tat org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)\r\n\tat org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)\r\n\tat org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:526)\r\n\tat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)\r\n\tat org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)\r\n\tat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)\r\n\tat org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)\r\n\tat org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)\r\n\tat org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)\r\n\tat org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)\r\n\tat org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1579)\r\n\tat org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)\r\n\tat org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)\r\n\tat java.lang.Thread.run(Unknown Source)\r\nCaused by: org.apache.ibatis.exceptions.PersistenceException: \r\n### Error querying database.  Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.\r\n### The error may exist in file [E:\\eclipse\\workspace\\cms_jd1911\\target\\classes\\mapper\\UserMapper.xml]\r\n### The error may involve com.briup.dao.UserMapper.selectByExample\r\n### The error occurred while executing a query\r\n### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.\r\n\tat org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)\r\n\tat org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:149)\r\n\tat org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\r\n\tat java.lang.reflect.Method.invoke(Unknown Source)\r\n\tat org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426)\r\n\t... 58 more\r\nCaused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.\r\n\tat org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:82)\r\n\tat org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:80)\r\n\tat org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:67)\r\n\tat org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:336)\r\n\tat org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:86)\r\n\tat org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62)\r\n\tat org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324)\r\n\tat org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)\r\n\tat org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)\r\n\tat org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83)\r\n\tat org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)\r\n\t... 64 more\r\nCaused by: java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.\r\n\tat com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110)\r\n\tat com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)\r\n\tat com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)\r\n\tat com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)\r\n\tat com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73)\r\n\tat com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:906)\r\n\tat com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:831)\r\n\tat com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:456)\r\n\tat com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246)\r\n\tat com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199)\r\n\tat com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138)\r\n\tat com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:353)\r\n\tat com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201)\r\n\tat com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:473)\r\n\tat com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:562)\r\n\tat com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115)\r\n\tat com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112)\r\n\tat org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:158)\r\n\tat org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:116)\r\n\tat org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:79)\r\n\t... 74 more\r\nCaused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: 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.\r\n\tat sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\r\n\tat sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)\r\n\tat sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)\r\n\tat java.lang.reflect.Constructor.newInstance(Unknown Source)\r\n\tat com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)\r\n\tat com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:85)\r\n\tat com.mysql.cj.util.TimeUtil.getCanonicalTimezone(TimeUtil.java:132)\r\n\tat com.mysql.cj.protocol.a.NativeProtocol.configureTimezone(NativeProtocol.java:2121)\r\n\tat com.mysql.cj.protocol.a.NativeProtocol.initServerSession(NativeProtocol.java:2145)\r\n\tat com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:1310)\r\n\tat com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:869)\r\n\t... 88 more\r\n",
  "path": "/test/findAll"
}

在这里插入图片描述

出现问题的原因

spring.datasource.url连接时设置出错。

解决方法

在数据库后方加入如下代码。
在这里插入图片描述

spring.datasource.url=jdbc:mysql://127.0.0.1:3306/cmsjd1911?serverTimezone=UTC&useUnicode=true&zeroDateTimeBehavior=convertToNull&autoReconnect=true&characterEncoding=utf-8

解决结果

问题已解决。数据正常显示。
在这里插入图片描述

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

智能推荐

dfrobot公司印象_doctorlyly的博客-程序员ITS203_dfrobot的solgen

这家公司产品很多,有个编译器不错叫upycraft还有阿里云的套装 gravity还有代码,可以拿来用最近的对接阿里云的程序版本是0.0.9下载了以后,有个tools 里面有个get. exe运行它就能被arduino识别出来了,不用从板管理里安装...

Eclipse无法启动_HHTide的博客-程序员ITS203

.mainData.1文件损坏,删除后成功打开Eclipse。

移动端滑动验证浏览器屏幕会跟着滑动验证移动的问题_bin-blog的博客-程序员ITS203_手机网页滑图认证网页跟着划怎么办

解决方法一:html{touch-action:none;touch-action:pan-y;}解决方法二:var startX,startY;document.addEventListener(“touchstart”,function(e){ startX = e.targetTouches[0].pageX; startY = e.targetTouches[0].pageY;});document.addEventListener(“touchmove”,function(

php JpGraph使用和中文乱码_openxw船长的博客-程序员ITS203

使用在使用JpGraph的时候我一般是把它的类库放到了程序的根目录下面(解压之后的src中的文件,除了Examples文件夹之外)在用的时候只需要include就可以了 还可以将解压之后的src中的文件重命名为jpgraph,将它放到d盘,再在php.ini文件中添加到include_path中,我的如下:include_path = ".;c:/php/include

开启Apache的server-status_kevin-sky的博客-程序员ITS203

最近经常发现一台 Apache 服务器监控报警,登陆服务器后发现 Apache 的进程占用过多的服务器资源而导致无法响应,查看 Apache 的日志,太庞杂又没法直观的看出问题来。还好 Apache 自带的 server-status 功能可以很好解决问题。要启用 server-status 必须首先加载 server-status 模块,你可以用以下命令查看是否已经加载了模块:

图片处理——基于openCV实现美颜相机_徐福记456的博客-程序员ITS203_opencv美颜相机

今天是2017年最后一晚,希望大家元旦前夕玩得开心,准备迎接2018全新的一年,活出程序员的态度。        最近发现有些女孩在朋友圈发的自拍照肤白貌美,甚至头上魔幻般地长出猫耳朵、猫鼻子、猫胡须,各种调皮搞怪。这一切归功于程序员们不懈努力,推动科技发展,最终科技提高生活品质。美颜相机、美妆相机、秒拍、天天P图们让自拍更加精彩,带有滤镜、美颜、宠萌等各种效果。讲真的,一开始我比较好奇的是宠

随便推点

s905各种型号的区别_液压油型号有何区别?液压油32号和46号区别?_weixin_39962153的博客-程序员ITS203

液压油型号有何区别?液压油32号和46号区别?相同品牌液压油的产品质量相同,不同型号规格的液压油它的粘度不一样,液压油46号的粘度比液压油32号的粘度大,使用两种型号的液压油要按照所处的地方的环境温度采用。下方具体化介紹一下46号与32号的区别:一、假如需要的压力大,则选择46#,假如采用32#则可能性会出现内漏而不能提供足够的压力。二、假如在江苏省使用,推荐用46#,假如用32#,则可能性会出現...

office安装教程_fengdong1996的博客-程序员ITS203_office

自己的office2010试用到期了,从网上搜了一个激活码试着激活竟然还真的激活了,特意记下来防止以后使用。1、首先需要查看office2010安装位置,将此路径复制下来:(我的时win10默认安装位置是C:\Program Files (x86)\Microsoft Office\Office14)2、打开cmd输入如下命令进入office安装目录(注:需要将下面的目录修改为自己的offic...

SparkShell读取json文件_张俊杰1994的博客-程序员ITS203

SparkShell读取Linux本地json文件root/soft/person.json就是本机路径var df = spark.read.format(“json”).load(“file:///root/soft/person.json”)scala&gt; var df = spark.read.format("json").load("file:///root/soft/person.json")df: org.apache.spark.sql.DataFrame = [_cor

goland报错:go: go.mod file not found in current directory or any parent directory; see ‘go help module_我有一个魔盒的博客-程序员ITS203_goland go mod file not found

IDE编辑器:goland现象原因:运行文件路径配置错误解决edit configurations(编辑配置)修改路径将路径具体到要运行的文件点击ok保存。再次点击“run”执行成功。

UVA1025 Thematic Contests_SwustLpf的博客-程序员ITS203_thematic contests

文章目录题目链接:题目链接:题意:有N个站台,最终时间T,然后N-1个数表示每两个站台之间需要的时间,然后再给一个M1表示有M1个发车时间,表示从左到右这个方向的火车的发车时间,以及一个M2和M2个数表示从左到右这个方向的火车的发车时间。问这个人从1站台出发,T时刻要到达N站台,但要停留在站台上的时间最少,也就是说尽可能多的时间在火车上比如第一个样例:4555 10 1540 5 ...

推荐文章

热门文章

相关标签