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

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. [CSP-S模拟测试]:游戏(最短路)

    题目传送门(内部题35) 输入格式 第一行,两个正整数$X,Y$.第二行,三个非负整数$A,B,C$.第三行,一个正整数$N$.接下来$N$行,每行两个非负整数$x_i,y_i$. 输出格式 一行,一 ...

  2. [NOIP模拟25]题解

    A.字符串 Catalan数不能再裸了 #include<cstdio> #include<iostream> #include<cstring> using na ...

  3. Django基础篇(二)与mysql配合使用

    需求:模拟实现学员管理系统.<*_* 从基础做起> 表结构如下: 班级/学生/老师 班级表: id     title 1       xx 2 xx 学生表: id    name    ...

  4. JS-动态加载

    var s = document.createElement('script'); s.setAttribute('src', ''); s.setAttribute('type', 'text/ja ...

  5. js匿名函数测试

    js匿名函数测试 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> < ...

  6. Java 空字符串和 字符串为null的区别

    之前一直没有搞清楚 字符串为空和字符串为null的区别,今天写代码一直出现NullPointerException异常,我一直没有搞清楚,后来发现我是这样写的 String s = null; s = ...

  7. 树状数据删除(TP5)

    应用场景:类似上图中树状菜单,选中一级菜单 点击上方删除按钮 所有子菜单删除 以下是代码截图(代码基于 TP5)

  8. 爬虫(三)—— BeautifulSoup模块获取元素

    目录 BeautifulSoup 一.BeautifulSoup简介 二.安装模块 三.解析器 四.Beautiful Soup的使用 五.查找元素 1.遍历文档树 2.搜索文档树 Beautiful ...

  9. CS如何调用JS

    this.ClientScript.RegisterStartupScript(this.GetType(), "", "RunClick()", true); ...

  10. QQ邮箱客户端配置

    接收协议:IMAP 接收邮箱服务器地址:imap.qq.com 端口:993 加密方法:TLS 发送协议:SMTP 发送服务器:smtp.qq.com 端口:465 加密方法:TLS