当前位置:网站首页>【无标题】
【无标题】
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”/>
边栏推荐
- MySQL1
- Clion configuring WSL tool chain
- MySQL (data types and integrity constraints)
- The difference between static method and instance method
- matplotlib
- 2022 Hangzhou Electric Multi school first Dragon Slayer (dfs+ state compression)
- [JVM learning 03] class loading and bytecode Technology
- Type-C PD protocol chip while charging and listening
- Tcl/tk grouping and replacement rules
- About core files
猜你喜欢

OPENGL学习(三)GLUT二维图像绘制
![[JVM learning 03] class loading and bytecode Technology](/img/b4/9482b02b58580171235fd4c36129e9.png)
[JVM learning 03] class loading and bytecode Technology

卷积神经网络感受野计算指南

ETL development tool kettle download installation environment construction and use tutorial

FPGA 20个例程篇:9.DDR3内存颗粒初始化写入并通过RS232读取(下)

轻松学Pytorch-迁移学习实现表面缺陷检查

OpenGL learning (III) glut two-dimensional image rendering

Understand corners_ Align, two perspectives for viewing pixels

今日睡眠质量记录79分

为什么梯度是函数变化最快的方向
随机推荐
32-bit stack overflow advanced
PostgreSQL weekly news - July 13, 2022
PostgreSQL Elementary / intermediate / advanced certification examination (7.16) passed the candidates' publicity
JVM方法调用
pyhanlp安装教程
Integer
FPGA 20个例程篇:9.DDR3内存颗粒初始化写入并通过RS232读取(上)
MySQL1
Those gods on Zhihu reply
Taokeeper environment setup
文献阅读:GoPose 3D Human Pose Estimation Using WiFi
Taokeeper environment setup
MySQL1
Typora user manual
Zooinspector Download
Getaverse, a distant bridge to Web3
New stage of investment
asp. Net coree file upload and download example
Why is gradient the fastest changing direction of function
Web