报错:The server time zone value ‘�й���ʱ��‘ is unrecognied
报错:The server time zone value ‘�й���ʱ��’ is unrecognied
当我们通过JDBC连接数据库的时候有时候会报出以下的错误:
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 specific time zone value if you want to utilize time zone support.
翻译一下就是:服务器时区值’�й���ʱ��’ 无法识别或表示多个时区。如果要使用时区支持,必须配置服务器或JDBC驱动程序(通过“serverTimezone”配置属性)以使用更具体的时区值。
这是由于使用的JDBC驱动包版本高于6(包括6),当我们使用这些版本连接要使用的URL时,必须加上serverTimezone参数,来设置时区。
解决方法1
将JDBC连接的URL修改为:
jdbc:mysql://localhost:3306/数据库名?serverTimezone=UTC
这里UTC代表全球标准时间,可以根据需要更改其值。
我们使用的时间是北京时间,即东八区时间,领先UTC八个小时。
所以我们可以将URL修改为:
jdbc:mysql://127.0.0.1:3306/test?serverTimezone=GMT%2b8
//上海时区也为东八区
jdbc:mysql://localhost:3306/数据库名?serverTimezone=Asia/Shanghai
解决方法2
当然我们可以直接通过更改使用的驱动包版本来解决该问题,只要使用6以下的版本就能解决。
报错:The server time zone value ‘�й���ʱ��‘ is unrecognied相关推荐
- 解决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 笔者在使 ...
- 数据库连接报错:The server time zone value '�й���ʱ��' is unrecognized
最近使用maven框架学习原生JDBC时遇到了如下错误: Exception in thread "main" java.sql.SQLException: The server ...
- 记一次连接数据库报错The server time zone value '�й���ʱ��' is unrecognized or represents more than one time zo
今天在使用mybatis连接数据库时报了如下错误: The server time zone value '�й���ʱ��' is unrecognized or represents more ...
- mysql报错The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zo
练习C3P0连接mysql时报错: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than ...
- springboot 连接MySQL的时候报错The server time zone value ‘Öйú±ê׼ʱ¼ä‘ is unrec
出现这个报错的是因为mysql的时区问题 url: jdbc:mysql://localhost:3306/orderingsystem?useUnicode=true&characterEn ...
- ideal连接数据库报错The server time zone value ‘�й���ʱ��’ is unrecognized or represents more than one time
在jdbc连接的url后面加上serverTimezone=GMT 即 jdbc:mysql://localhost:3306/数据库名?serverTimezone=GMT
- 启动mysql服务是报错找不到pid_mysql报错 The server quit without updating PID file
我的mysql总是在重启的时候mysql的数据总是会初始化,我以为是的配置问题,所以在网上找了各种方法测试都不通过,下面看我遇到的几个错误. 重启mysql失败 [root@wulaoer_mysql ...
- 【Flink】Flink 写入 kafka 报错 The server disconnected before a response was received
文章目录 1.场景再现 1.1.概述 1.场景再现 1.1.概述 Flink 写入 kafka 报错 The server disconnected before a response was rec ...
- php7链接数据库报错The server requested authentication method unknown to the client
php7链接数据库报错The server requested authentication method unknown to the client 主要原因 是因为 mysql 8.0 升级了密码 ...
最新文章
- 带您走进七周七语言的程序世界
- pku1182(食物链) hdu3047 Zjnu Stadium
- MATLAB实用知识,如何对函数的输入进行检查和解析?
- Homestead 使用总结
- NSArray打印汉字的方法
- beanpostprocessor与@autowired的关系
- 秦磊:被分众CEO“忽悠”往事
- SQL-33 创建一个actor表,包含如下列信息
- 关于flink的setCommitOffsetsOnCheckpoints
- 最大频偏和最大相位偏移_振荡器的相位噪声模型
- Tensorflow Python3 做神经网络(视频教程)
- linux csi 摄像头,A20 linux(dragonboard)同时使用Parallel CSI Camera及UVC
- 计算机盘中文件夹丢失,电脑装机后原区分f盘内文件夹丢失如何找回
- Access2016学习5
- 人工智能的利弊?好处和危害都有哪些
- Navicat Premium 导入SQL文件
- 习题课3-1(动态规划)
- 计算机无法删除用户,怎么彻底删除一个用户
- KubeEdge SIG AI 进展与规划
- 计算机网络具备哪些要素,一个计算机网络必须具备以下3个基本要素