The server time zone value
异常描述
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相关推荐
- java.sql.SQLException: The server time zone value ‘Öйú±ê׼ʱ¼ 解决方案
java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ 解决方案 参考文章: (1)java.sql.SQLException: ...
- 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 ...
- 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 ...
- MySQL 数据库时区设置方法,“The server time zone value ‘�й���ʱ��‘ is unrecognized or represents ...” 问题解决
连接 mysql 数据库时提示如下异常,是时区问题导致的. An error occurred while establishing the connection:Long Message: The ...
- 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 ...
- 解决JDBC连接mysql时server time zone问题及com.mysql.jdbc.Driver is deprecated
首先这里产生了两个错误,一个是jdbc加载驱动问题,另一个是time zone即mysql服务驱动和JDBC驱动时区不同步. Loading class 'com.mysql.jdbc.Driver' ...
- 解决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 笔者在使 ...
- 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 ...
- 连接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 ...
最新文章
- 五角大楼公布UFO报告,不明飞行物到底是什么?(全文)
- Rails测试《一》fixtures简介
- 一名Android程序员如何减少代码中该死的-if-else-嵌套,怎么让代码更简洁?
- bzoj5368 [Pkusc2018]真实排名
- java.lang.OutOfMemoryError​异常解决方法
- html中内联的form,bootstrap3.0教程之表单(form)使用详解
- 2022MWC上海预计6月29号开幕
- WayOs内置智能重启:自动计算UTC时间为本地时间,可以调整为几时重启
- html无节日为空,这个生死相拥的节日_311.Html
- 如何安装mgn-mqt82.exe以及qtp10下载
- win10分屏快捷键无法使用_Win10系统Win快捷键不能用怎么办_win10 Win快捷键无法使用如何解决-系统城...
- 测试打印机性能的软件,打印速度测试
- Android科大讯飞语音集成(语音输入,语音合成文字转声音)
- 【安全】(三)Django之SQL注入防御
- Python 识别图片文字( Tesseract 安装使用 )
- 一文详解 Http 短轮询、长轮询
- go 获取文件的md5值
- 怎样给win7系统硬盘分区
- Java Annotation 应用 -- 导出Excel表格
- jsp上传文件到服务器
热门文章
- EasyUI中放置Droppable的使用以及实现拖拽排序
- 【知识图谱】知识融合
- 关于flutter列表的性能优化,你必须要了解的
- flutter项目如何打包(android)
- arduino 勘智k210_如何评价嘉楠耘智的勘智K210芯片?
- 周报速递丨百度与美团等互联互通;京东Shopify达成合作
- 做重?做轻?关键是要解决客户问题
- 【CEO赠书】《浪潮之巅》:计算机史上的人间词话
- 两个等号(==)和三个等号(===)的区别
- mysql查询今天、昨天、7天、近30天、本月、上一月 数据