解决:Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.

`com.mysql.jdbc.Driver. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver‘的解决办法 com.mysql.jdbc.Driver. This is deprecated. The new driver class is com.mysql.cj.jdbc.Driver‘的解决办法 说多了都是泪,搭建这个项目遇到的问题太多了,csdn下载的一个javaweb项目 github上也下载了几个,还学会了github上下载东西方法,全是英文的… 问题1:This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver解决 阅读详情

问题解决很简单,主要是你得知道这是为什么。

1、问题:

我在搭建完项目环境,启动项目测试时报了个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.jdbc.Driver 已经被弃用,建议你使用新的驱动 com.mysql.cj.jdbc.Driver。 

2、解决办法:

直接在yml配置文件里将驱动名更正为 com.mysql.cj.jdbc.Driver即可,如下图所示:

3、为什么会抱这个警告?

我们之前项目都是配置的com.mysql.jdbc.Driver,都没问题,为什么这次有问题,猜想应该是版本不同。果然,只要我们使用的 mysql-connector-java.jar 是6.0或以上版本就会报这个警告。我查看了我的这个jar包版本为8.0.15:

 

 

 

解决报错提示:Loading class `com.mysql.jdbc.Driver.The new driver class iscom.mysql.cj.jdbc.Driver. 目录一、报错描述二、报错原因三、解决方式 一、报错描述 1、springboot项目配置mysql驱动com.mysql.jdbc.Driver报错,如下图: 二、报错原因 提示信息表明数据库驱动com.mysql.jdbc.Driver’已经被弃用了、应当使用新的驱动com.mysql.cj.jdbc.Driver’ 三、解决方式 把com.mysql.jdbc.Driver 改为 com.mysql.cj.jdbc.Driver,如下图: 修改之后重启项目,报错如下图: 根据报 阅读详情

相关推荐

Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is`...

springboot项目,用了最新的mysql连接驱动,报错如下: 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 ...

橙子君的博客 2万+

Loading class `com.mysql.jdbc.Driver'. This is deprecated警告处理,jdbc更新处

声明:使用JDK9、MYSQL8、idea   1.报错信息是这样的; 处理:提示信息表明数据库驱动com.mysql.jdbc.Driver'已经被弃用了、应当使用新的驱动com.mysql.cj.jdbc.Driver' 所以,按照提示更改jdbc.properties配置 .com.mysql.jdbc.Driver  改为  com.mysql.cj.jdbc.Driver ...

Syntacticsugar's blog 36万+

快速解决Loading class `com.mysql.jdbc.Driver. This is deprecated. The new driver class is `com.mysql.c

快速解决报错: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.

快乐学习 1万+

Loading class `com.mysql.jdbc.Driver. This is deprecated. The new driver class is `com.mysql.cj.jdb

Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdb

u012004795的博客 6999

解决Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.j...

解决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 cl...

LYly_B的博客 2万+

解决Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.

解决Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class iscom.mysql.cj.jdbc.Driver. 异常: Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class iscom.m...

weixin_44012721的博客 727

解决Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.j

解决Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class iscom.mysql.cj.jdbc.Driver. 整合spring boot项目过程中出现的,用了最新的mysql 连接驱动 需要将 com.mysql.jdbc.Driver 改为 com.mysql.cj.jdbc.Dri...

weixin_40359716的博客 670

Loading class `com.mysql.jdbc.Driver'. Establishing SSL connection without server's identity verific

问题一 Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class iscom.mysql.cj.jdbc.Driver. The driver is automatically registered via the SPI and manual loading of the driver cla...

Cara 238

解决Loading class `com.mysql.jdbc.Driver. This is deprecated. The new driver class is `com.mysql.cj.j

Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. 整合spring boot项目过程中出现的,用了最新的mysql 连接驱动 application-dev.properties spring.datasource.url=jdbc:mysql://localhost:3306/test?serverTimezone=GMT%2.

lee_x_lee的博客 5万+

JDBC连接MySQL Loading class `com.mysql.jdbc.Driver'. This is deprecated

解决问题 今天使用JDBC连接数据库时报了异常 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 lo...

Wu 2万+

Loading class `com.mysql.jdbc.Driver. This is deprecated. The new driver class is`com.mysql.cj.jdbc

Loading class `com.mysql.jdbc.Driver. This is deprecated. The new driver class is com.mysql.cj.jdbc.Driver 其实这个就是你的MySQL数据库的驱动太高了。 解决方案,在你的程序中找到你加载MySQL驱动的那一条语句,如下 String drive = "com.mysql.jdbc.Driver"; 把他改成就可以了 String drive = "com.mysql.cj.jdbc.Driver";

起名好难呀! 2617

Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdb

//第一个异常 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 driv...

大气的名字 7476

spring boot 加载出现 Loading class `com.mysql.jdbc.Driver'. This is deprecated.

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...

liuxy_236的博客 7681
上一篇: 如何将:sdf.parse(dateStr)方法返回的Date类型时间数据: Fri May 10 00:00:00 CST 2019 转为:yyyy-MM-dd格式的Date类型数据
下一篇: 解决:InvalidConnectionAttributeException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or
aigoV
博客等级 码龄10年 98粉丝 61原创
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值