当前位置:网站首页>【无标题】
【无标题】
2022-07-24 19:14:00 【amcomputer】
1 报错信息
Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is 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.
### The error may exist in class path resource [com/yang/mapper/UserMapper.xml]
### The error may involve com.yang.mapper.UserMapper.selectUser
### The error occurred while executing a query
### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is 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.
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:78)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:440)
at com.sun.proxy.$Proxy7.selectList(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:223)
at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:147)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:80)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:57)
at com.sun.proxy.$Proxy8.selectUser(Unknown Source)
at com.yang.mapper.UserMapperImpl.selectUser(UserMapperImpl.java:27)
2 解决方法
<bean id="myDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.cj.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/mybatis?useSSL=true&useUnicode=true&characterEncoding=UTF8&serverTimezone=UTC"/>
<property name="username" value="root"/>
<property name="password" value="mysql"/>
</bean>
“jdbc:mysql://localhost:3306/mybatis?useSSL=true&useUnicode=true&characterEncoding=UTF8&serverTimezone=UTC”/>
边栏推荐
- Colon sorting code implementation
- 字符串的遍历及拼接
- PCI express physical layer - electrical part
- Reading notes of XXL job source code
- Analysis of several possible causes of 0xc0000005 memory violation
- [Huawei lyevk-3861a intelligent IOT development board evaluation] unpacking experience and Hisilicon hi3861v100 chip learning experience
- Those gods on Zhihu reply
- Introduction to VIM
- Clion configuring WSL tool chain
- ETL development tool kettle download installation environment construction and use tutorial
猜你喜欢

Type-C PD protocol chip while charging and listening

Summary of articles in 2020

【历史上的今天】7 月 24 日:Caldera 诉微软案;AMD 宣布收购 ATI;谷歌推出 Chromecast

Web

In the spring of domestic databases

MySQL1

FPGA 20 routines: 9. DDR3 memory particle initialization write and read through RS232 (Part 1)

Nftscan and port3 have reached strategic cooperation in the field of NFT data

Timed task framework

Make C #
随机推荐
2022 Hangzhou Electric Multi school first Dragon Slayer (dfs+ state compression)
[JVM learning 04] JMM memory model
Compressed string
FPGA 20 routines: 9. DDR3 memory particle initialization write and read through RS232 (Part 1)
Sequences, time series and prediction in tessorflow quizs on coursera (I)
Detailed explanation of DHCP distribution address of routing / layer 3 switch [Huawei ENSP]
信道状态信息(CSI)共轭相乘去噪法
Timed task framework
拦截器和过滤器
Mysql数据库,去重,连接篇
Mysql database, subquery, union, limit
Biopharmaceutical safety, power supply and production guarantee
Those gods on Zhihu reply
PostgreSQL weekly news - July 13, 2022
[question 39] special question for Niuke in-depth learning
MySQL index principle and query optimization "suggestions collection"
MySQL1
Convolution neural network receptive field calculation Guide
关于core文件
【JVM学习04】JMM内存模型