使用spring boot整合MySQL时一直报

java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone

报错信息

系统时区的错误

查看mysql时区

show VARIABLES like "%time_zone%"

解决方法:

  1.在原来的参数“url”后面,拼上这个字符串:?serverTimezone=GMT%2B8,

    如:jdbc:mysql://localhost:3306/test?serverTimezone=GMT%2B8

      东八区的表示:

        GMT%2B8,GMT+8,北京时间东八区

        Asia/Shangha,上海时间

      为何没有asia/beijing时区?

  2.设置mysql的时区

    MySQL默认的时区是UTC时区

    (1)永久的修改:修改mysql的配置文件,添加:default-time-zone='+08:00',重启mysql生效

(2)临时的修改:执行mysql命令 set global time_zone='+08:00',立即生效,重启mysql后失效

  

    

    

解决java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone的更多相关文章

  1. 吴裕雄--天生自然 JAVA开发学习:解决java.sql.SQLException: The server time zone value报错

    这个异常是时区的错误,因此只你需要设置为你当前系统时区即可,解决方案如下: import java.sql.Connection ; import java.sql.DriverManager ; i ...

  2. 解决mysql java.sql.SQLException: The server time zone value‘XXXXXX' is unrecognized or represents...

    解决 java.sql.SQLException: The server time zone value 'XXXXXX' is unrecognized or represents more tha ...

  3. 连接mysql数据库报错java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized...解决方法

    今天连接mysql数据库报错如下: java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or r ...

  4. 连接mysql报错java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized...解决方法

    报错内容: java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represents mo ...

  5. java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ 解决方案

    //第一个异常 Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysq ...

  6. JDBC连接数据库报错:java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone. ......

    问题:Java程序使用JDBC连接MySQL数据库时,控制台报错如下: java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' ...

  7. Exception in thread “main” java.sql.SQLException: The server time zone value ‘�й���׼ʱ��’ is unrecognized or represents more than one time zone.

    Exception in thread “main” java.sql.SQLException: The server time zone value ‘�й���׼ʱ��’ is unrecogn ...

  8. 【MySQL】java.sql.SQLException: The server time zone value

    错误:Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: The se ...

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

    错误信息 java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents ...

随机推荐

  1. 20172302 《Java软件结构与数据结构》第一周学习总结

    2018下半年学习总结博客总目录:第一周 教材学习内容总结 第一章 概述 1.软件质量 软件工程(Software Engineering)是一门关于高质量软件开发的技术和理论的学科. 软件质量从以下 ...

  2. weblogic10 部署 spring+cxf ,调用时报:cannot create a secure XmlInputFactory

    weblogic10 部署 spring+cxf ,调用时报:cannot create a secure XmlInputFactory   一个cxf webservice项目部署到tomcat能 ...

  3. [原创]Java性能优化权威指南读书思维导图4

    [原创]Java性能优化权威指南读书思维导图4

  4. Using a Virtex Device to Drive 5V CMOS-Level Signals

    Must tri-state outputs and use an external resistor to pull up to 5V To drive 5V CMOS-level inputs, ...

  5. Java全栈程序员之04:Ubuntu下安装MySQL、注册服务及Navcat

    在安装MySQL之前,我们先来介绍一下Ubuntu下软件的安装方式.首先回顾下,我们安装JDK,使用的是后缀名为tar.gz的安装包.安装idea,使用的是tar.gz:那有没有别的安装方式呢? 1. ...

  6. java异常中throw和throws的区别

    throws和throwthrows:用来声明一个方法可能产生的所有异常,不做任何处理而是将异常往上传,谁调用我我就抛给谁.  用在方法声明后面,跟的是异常类名  可以跟多个异常类名,用逗号隔开  表 ...

  7. float:浮点型double:双精度实型decimal:数字型单精度浮点数(Single)双精度浮点数(double)

        单精度浮点数(Single) 双精度浮点数(double)       Decimal为SQL Server.MySql等数据库的一种数据类型,不属于浮点数类型,可以在定义时划定整数部分以及小 ...

  8. 在DevExpress程序中使用内置的图标构建美观的界面元素【转】

    https://www.cnblogs.com/wuhuacong/p/6217012.html 在我们一般的程序中,为一般的界面元素添加一定的图标展示,有助于提升界面的整体的美观.结合排版布局,以及 ...

  9. “正在注册字体”问题解决

    在win7下安装老软件,卡在"正在注册字体"了,检查发现是ocx注册有问题. 重写一个ocx注册的批处理就好了. 如: regsvr32 "C:\Program File ...

  10. C# System.Collections.Queue

    using System; using System.Collections; public class SamplesQueue { public static void Main() { // C ...