Tomcat启动报:The Server time zone value 'XXXXX' 乱码问题解决
今天给自己项目打包到服务器发布时,运行时,发现报
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.
错误
经过查询资料发现是
MySql本身的时区设置的问题导致的
解决办法:
方法一:
1.在mysql安装位置下找到my.ini
文件;
2.修改my.ini
文件中:在[mysqld]
下方,添加
default-time-zone='+08:00'
3.重启即可
方法二:
我是springboot项目,使用tomcat发布时报的,可以使用一下方法解决
在你项目的数据库配置url位置,后面加上 serverTimezone=UTC
jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
如果发现新加数据比当前时间少8个小时,或者查询显示出来的数据比数据库入库的时间多8个小时,可以改为:serverTimezone=GMT%2B8
这样新添加的数据为正常时间
结束
Tomcat启动报:The Server time zone value 'XXXXX' 乱码问题解决的更多相关文章
- maven项目使用tomcat启动报错:Server Tomcat v8.5 Server at localhost failed to start
背景说明:1)该项目为maven项目,使用的maven的本地仓库里有不少之前使用过下载的jar包: 2)从svn下载该项目后,无报错情况: 3)部署到tomcat启动报错 如下 : 4)在网上搜索了很 ...
- tomcat启动报错
[toc]启动错误 does not exist or is not a readable directory 问题:tomcat启动报错:does not exist or is not a rea ...
- Tomcat启动报错:[The configuration may be corrupt or incomplete]的解决方案
1,场景说明: 偶然碰见Tomcat启动报错,此时并没有Add任何Web项目: Could not load the Tomcat server configuration at /Servers/T ...
- Tomcat启动报错:StandardServer.await: create[8005] java.net.BindException: Cannot assign requested address
Tomcat启动报错:StandardServer.await: create[8005] java.net.BindException: Cannot assign requested addres ...
- tomcat启动 报org.apache.catalina.LifecycleException异常
java 服务器 tomcat启动 报org.apache.catalina.LifecycleException异常 异常代码如下: [2018-05-10 04:45:08,856] Artifa ...
- tomcat启动报错,找不到相应的 queue,从而引发内存泄漏
tomcat启动报错,无法创建 bean listenerStatusChangeDealHandler, no queue 'STOCK.NOTIFY_CHANGE.INTER.CACHE.QUEU ...
- Tomcat启动报错:java.net.BindException: Cannot assign requested address: JVM_Bind
Tomcat启动报错:java.net.BindException: Cannot assign requested address: JVM_Bind Tomcat Cannot assign re ...
- (转)Eclipse4.2 Tomcat启动报错 A child container failed during start
Eclipse4.2 Tomcat启动报错 A child container failed during start 2013-5-21 15:02:24 org.apache.catalina. ...
- tomcat启动报错There is insufficient memory for the Java Runtime Environment to continue
tomcat启动报错后显示以下错误 ## There is insufficient memory for the Java Runtime Environment to continue.# Nat ...
随机推荐
- 【纪中集训】2019.08.10【NOIP提高组】模拟 A 组TJ
T1 Description Solution 有待填坑-- T2 Description 给定一个\(h(≤10)\)层.\(n(≤10)\)行.\(m(≤10)\)列的由泥土组成的立方体,挖开\( ...
- 【从0到1,搭建Spring Boot+RESTful API+Shiro+Mybatis+SQLServer权限系统】02、创建新的SpringBoot项目
1.创建项目 得到项目架构 2.测试项目Web功能 默认端口为8080,运行后,输入localhost:8080/index即可访问到网页 到这里,项目构建成功!
- svn提交代码失败提示清理(清理失败并且报错信息乱码解决办法)
原因是;svn的数据库队列原因 1,下载sqlite3.exe, sqlite官网http://www.sqlite.org/download.html) 2.在Windows的D盘中新建tools ...
- JS-插件编写
# 参数处理 JS: function plugin_mian_func(options){ var defaluts = { opt1: 'opt1', opt2: 'opt2', opt3: { ...
- python学习笔记:python简介和入门
编程语言各有千秋.C语言适合开发那些追求运行速度.充分发挥硬件性能的程序.而Python是用来编写应用程序的高级编程语言. Python就为我们提供了非常完善的基础代码库,覆盖了网络.文件.GUI.数 ...
- 使用postman做接口测试----柠檬不萌!
目录 一.GET和POST请求的区别 二.http协议 1.http请求分为两个部分 2.http状态码 三.使用postman测试HTTP接口 1.请求方式:get 2.请求方式:post 3.请求 ...
- es+mongodb 整合
之前公司项目的数据都是从mysql查询,后面需求变更:同时技术上相应的也要改变策略,决定将mongodb和mysql的数据通过es建立索引来查询: 对于还没有接触或者真正了解es的可以先看一下相关Lu ...
- SpringMVC学习(4):数据绑定1 @RequestParam
在系列(3)中我们介绍了请求是如何映射到一个action上的,下一步当然是如何获取到请求中的数据,这就引出了本篇所要讲的内容-数据绑定. 首先看一下都有哪些绑定数据的注解: 1.@RequestPar ...
- MySQL字符集不一致导致查询SQL性能问题
今天做了一个MySQL数据库中的SQL优化. 结论是关联字段字符集不同,导致索引不可用. 查询的SQL如下: select `Alias`.`Grade`, `Alias`.`id`, `Alias` ...
- UICollectionView中的cell包含UIScrollview
需求:在scrollview的子View不为0,当scrollview的展示的index不为0且向右滑动CollectionView.CollectionView不滑动Cell,而是让scrollvi ...