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 ...
随机推荐
- 【HDOJ6581】Vacation(模拟)
题意:有标号从0到n的n+1辆车,每辆车离终点的距离为s[i],车长为l[i],速度为v[i],规定不能超车,问何时所有车都能过终点线 n<=1e5,保证 思路: #include<bit ...
- What is the difference between UserControl, WebControl, RenderedControl and CompositeControl?
What is the difference between UserControl, WebControl, RenderedControl and CompositeControl? UserCo ...
- Jplayer用法
引用js:jquery.jplayer.min.js; body里面必须有这个: <div id="jplayer"></div> jplayer停止方法 ...
- Eclipse Missing artifact jdk.tools:jdk.tools:jar:1.6
Missing artifact jdk.tools:jdk.tools:jar:1.6 问题出在Eclipse Maven的支持上,在Eclipse下,java.home变量设置为用于启动Eclip ...
- Python 定时任务框架 APScheduler 详解
APScheduler 最近想写个任务调度程序,于是研究了下 Python 中的任务调度工具,比较有名的是:Celery,RQ,APScheduler. Celery:非常强大的分布式任务调度框架 R ...
- 力扣算法——134GasStation【M】
在一条环路上有 N 个加油站,其中第 i 个加油站有汽油 gas[i] 升. 你有一辆油箱容量无限的的汽车,从第 i 个加油站开往第 i+1 个加油站需要消耗汽油 cost[i] 升.你从其中的一个加 ...
- 2.Jmeter 快速入门教程(二)--创建简单web测试 打印 E-mail
今天我们就来实际用Jmeter创建一个测试场景,并进行性能测试. 注:由于本人使用中文版本,使用英文版本的请注意具体的菜单及参数名称. 1. 添加线程组(相当于lr里的scenario 设置) 打开j ...
- log4j日志记录到数据库
log4j API提供 org.apache.log4j.jdbc.JDBCAppender 对象,它能够将日志信息在指定的数据库. JDBCAppender 配置: Property 描述 buff ...
- mysql的时间存储格式
虽然mysql提供了datatime和timestamp两种存储时间的格式,但是如果设计较多计算,应存INT(11)类型.
- Spring Boot实现通用的接口参数校验
Spring Boot实现通用的接口参数校验 Harries Blog™ 2018-05-10 2418 阅读 http ACE Spring App API https AOP apache IDE ...