mysql5.6连接遇到的问题
2017-08-02 11:30
309 查看
maven项目 springcloud的demo
spring-mybatis整合 mysql数据库5.6
1. Caused by: java.lang.IllegalStateException: Cannot load driver class:
org.gjt.mm.mysql.Driver
改为 com.mysql.jdbc.Driver后,出现如下提示:
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.
最终改为: com.mysql.cj.jdbc.Driver
2. Caused by: com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: 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.
在数据库连接的url后加上 ?serverTimezone=UTC
示例: application.yml中关于数据源配置
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/db8001?serverTimezone=UTC
username: root
password: 123456
spring-mybatis整合 mysql数据库5.6
1. Caused by: java.lang.IllegalStateException: Cannot load driver class:
org.gjt.mm.mysql.Driver
改为 com.mysql.jdbc.Driver后,出现如下提示:
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.
最终改为: com.mysql.cj.jdbc.Driver
2. Caused by: com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: 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.
在数据库连接的url后加上 ?serverTimezone=UTC
示例: application.yml中关于数据源配置
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/db8001?serverTimezone=UTC
username: root
password: 123456
相关文章推荐
- C++与mysql连接遇到的问题汇总
- VS2015连接mysql遇到的几个问题
- java连接Mysql遇到新问题!!!如下异常怎么解决?
- myeclipse连接mysql遇到的小问题
- debian mysql安装以及navicat连接遇到的一个问题。
- log4j与MySQL长时间连接问题,自己也遇到这个问题了,转载也算记录下吧
- 安装mysql5.6(MySQL-5.6.27-1.linux_glibc2.5.x86_64.rpm-bundle.tar)遇到的问题
- Eclipse与Mysql连接中遇到的一个问题,让我苦恼好久....(记录自己的菜鸟经历)
- MySQL5.6在RHEL下用RPM包安装遇到的问题
- 安装mysql5.6遇到的问题
- 应用访问Mysql遇到的连接问题
- NodeJS连接MySQL时遇到的问题 Error: Connection lost: The server closed the connection.
- c++连接mysql5.6出错问题记录
- VC连接mysql遇到的问题
- 掌游 新项目:我采用NH连接MySql所遇到的问题
- 同一条sql在mysql5.6和5.7版本遇到的问题。
- mysql5.6的主从数据库遇到的问题
- 解决Python2.7 连接MySQL数据库遇到'can't connect to MySQL server on 'localhost'(10061)'问题
- Navicat连接mysql遇到的问题,网上整理的.
- MySql和VS2008连接遇到的问题