异常描述

Exception in thread "main" 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.

JDBC连接mysql 用的是.connector.6.0.jar

问题解决:

String url = "jdbc:mysql://localhost:3306/zdx?serverTimezone=UTC";

在url后面加上?serverTimezone=UTC

如下:

String url = "jdbc:mysql://localhost:3306/zdx?serverTimezone=UTC";

提示:Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.

这个问题不算错误,只是友好提示,如果不想要,在6.0的jar里,mysql可以自动加载驱动,

也即是

Class.forName("com.mysql.jdbc.Driver");这句话注释掉就不会再出现这个提示。

转载于:https://blog.51cto.com/zhangdongxu/1921999

The server time zone value相关推荐

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

    java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ 解决方案 参考文章: (1)java.sql.SQLException: ...

  2. The server time zone value is unrecognized or repr

    异常信息: The server time zone value is unrecognized or represents more than one time zone. You must con ...

  3. JDBC告警系列(一)The server time zone value 'ÖÐ' is unrecognized or represents more than one time zone....

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

  4. MySQL 数据库时区设置方法,“The server time zone value ‘�й���׼ʱ��‘ is unrecognized or represents ...” 问题解决

    连接 mysql 数据库时提示如下异常,是时区问题导致的. An error occurred while establishing the connection:Long Message: The ...

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

    场景 运行Mybatis的generator自动生成代码时提示: caused by :The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognize ...

  6. 解决JDBC连接mysql时server time zone问题及com.mysql.jdbc.Driver is deprecated

    首先这里产生了两个错误,一个是jdbc加载驱动问题,另一个是time zone即mysql服务驱动和JDBC驱动时区不同步. Loading class 'com.mysql.jdbc.Driver' ...

  7. 解决Hibernate报错The server time zone value is unrecognized or represents more than one time zone

    解决Hibernate报错The server time zone value is unrecognized or represents more than one time zone   笔者在使 ...

  8. java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized

    在application.yml中 spring:datasource:username: rootpassword:url: jdbc:mysql://127.0.0.1:3306/testdriv ...

  9. 连接MySql出现异常解决:java.sql.SQLException: The server time zone value is unrecognized or represents。

    QUESTION: java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represent ...

最新文章

  1. 五角大楼公布UFO报告,不明飞行物到底是什么?(全文)
  2. Rails测试《一》fixtures简介
  3. 一名Android程序员如何减少代码中该死的-if-else-嵌套,怎么让代码更简洁?
  4. bzoj5368 [Pkusc2018]真实排名
  5. java.lang.OutOfMemoryError​异常解决方法
  6. html中内联的form,bootstrap3.0教程之表单(form)使用详解
  7. 2022MWC上海预计6月29号开幕
  8. WayOs内置智能重启:自动计算UTC时间为本地时间,可以调整为几时重启
  9. html无节日为空,这个生死相拥的节日_311.Html
  10. 如何安装mgn-mqt82.exe以及qtp10下载
  11. win10分屏快捷键无法使用_Win10系统Win快捷键不能用怎么办_win10 Win快捷键无法使用如何解决-系统城...
  12. 测试打印机性能的软件,打印速度测试
  13. Android科大讯飞语音集成(语音输入,语音合成文字转声音)
  14. 【安全】(三)Django之SQL注入防御
  15. Python 识别图片文字( Tesseract 安装使用 )
  16. 一文详解 Http 短轮询、长轮询
  17. go 获取文件的md5值
  18. 怎样给win7系统硬盘分区
  19. Java Annotation 应用 -- 导出Excel表格
  20. jsp上传文件到服务器

热门文章

  1. EasyUI中放置Droppable的使用以及实现拖拽排序
  2. 【知识图谱】知识融合
  3. 关于flutter列表的性能优化,你必须要了解的
  4. flutter项目如何打包(android)
  5. arduino 勘智k210_如何评价嘉楠耘智的勘智K210芯片?
  6. 周报速递丨百度与美团等互联互通;京东Shopify达成合作
  7. 做重?做轻?关键是要解决客户问题
  8. 【CEO赠书】《浪潮之巅》:计算机史上的人间词话
  9. 两个等号(==)和三个等号(===)的区别
  10. mysql查询今天、昨天、7天、近30天、本月、上一月 数据