今天给自己项目打包到服务器发布时,运行时,发现报

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' 乱码问题解决的更多相关文章

  1. maven项目使用tomcat启动报错:Server Tomcat v8.5 Server at localhost failed to start

    背景说明:1)该项目为maven项目,使用的maven的本地仓库里有不少之前使用过下载的jar包: 2)从svn下载该项目后,无报错情况: 3)部署到tomcat启动报错 如下 : 4)在网上搜索了很 ...

  2. tomcat启动报错

    [toc]启动错误 does not exist or is not a readable directory 问题:tomcat启动报错:does not exist or is not a rea ...

  3. Tomcat启动报错:[The configuration may be corrupt or incomplete]的解决方案

    1,场景说明: 偶然碰见Tomcat启动报错,此时并没有Add任何Web项目: Could not load the Tomcat server configuration at /Servers/T ...

  4. Tomcat启动报错:StandardServer.await: create[8005] java.net.BindException: Cannot assign requested address

    Tomcat启动报错:StandardServer.await: create[8005] java.net.BindException: Cannot assign requested addres ...

  5. tomcat启动 报org.apache.catalina.LifecycleException异常

    java 服务器 tomcat启动 报org.apache.catalina.LifecycleException异常 异常代码如下: [2018-05-10 04:45:08,856] Artifa ...

  6. tomcat启动报错,找不到相应的 queue,从而引发内存泄漏

    tomcat启动报错,无法创建 bean listenerStatusChangeDealHandler, no queue 'STOCK.NOTIFY_CHANGE.INTER.CACHE.QUEU ...

  7. Tomcat启动报错:java.net.BindException: Cannot assign requested address: JVM_Bind

    Tomcat启动报错:java.net.BindException: Cannot assign requested address: JVM_Bind Tomcat Cannot assign re ...

  8. (转)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. ...

  9. 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 ...

随机推荐

  1. http协议和file协议的区别

    1.在本地直接使用浏览器打开  html文件 和 通过本地服务器打开  html文件  有什么区别呢.  https://segmentfault.com/q/1010000006554881/a-1 ...

  2. 通过findViewById()方法从layout中获取view并进行相应的转换时提示:"Cannot cast from View to AutoCompleteTextView"的解决办法!(转+自己错误)

    转:http://blog.csdn.net/zyz511919766/article/details/7453864 代码: package zyz.example.autocompletetext ...

  3. iOS 技能图谱

    # iOS 技能图谱## 编程语言 - Swift - Objective-C - C++/C - JavaScript ## 操作系统 - Mac OSX - iOS - watchOS - tvO ...

  4. Python sqlite3.ProgrammingError: You must not use 8-bit bytestrings unless you use a text_factory that can interpret 8-bit bytestrings......

    完整的错误信息如下: You must not use 8-bit bytestrings unless you use a text _factory that can interpret 8-bi ...

  5. Linux安装Oracle 10g

    目录 目录 环境 RHEL6 Configuration Update JDK 配置Oracle安装环境 硬件检测 软件检测 编辑配置文件 安装Oracle Database 环境 系统 RHEL6 ...

  6. Openstack组件部署 — Keystone Install & Create service entity and API endpoints

    目录 目录 前文列表 Install and configure Prerequisites 先决条件 Create the database for identity service 生成一个随机数 ...

  7. canvas简单画图板

    <!DOCTYPE html> <html lang='en'> <head> <meta charset='UTF-8'> <title> ...

  8. Java对象相等比较(Equals)

    以下代码显示如何实现equals()和hashCode()方法 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 ...

  9. shell编程:find命令

    写在前面 在linux的日常管理中,find的使用频率很高,熟练掌握对提高工作效率很有帮助. find的语法比较简单,常用参数的就那么几个,比如-name.-type.-ctime等.初学的同学直接看 ...

  10. 关于原生js中ie的attacheEvent事件用匿名函数改变this指向后,不能用detachEvent删除绑定事件的解决办法?

    博客搬迁,给你带来的不便,敬请谅解! http://www.suanliutudousi.com/2017/11/28/%e5%85%b3%e4%ba%8e%e5%8e%9f%e7%94%9fjs%e ...