mysql 问题 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 driver class is generally unnecessary.

这个问题 是在我整合项目过程中出现的,用了最新的mysql 连接驱动

以前版本的jdbc.properties

jdbc.driverClass = com.mysql.dbc.Driver
jdbc.url = jdbc:mysql://127.0.0.1:3306/db?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT
jdbc.username = root
jdbc.password = root123

现在按照最新官方提示支持将com.mysql.jdbc.Driver  改为  com.mysql.cj.jdbc.Driver

jdbc.driverClass = com.mysql.cj.jdbc.Driver
jdbc.url = jdbc:mysql://127.0.0.1:3306/db?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT
jdbc.username = root
jdbc.password = root123

这个是因为用的最新的数据库驱动的原因,用较早的版本就可以了。

 <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
            <version>5.1.41</version>
</dependency>

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

原文地址:https://www.cnblogs.com/panchanggui/p/10401763.html

时间: 2024-11-03 16:48:56

mysql 问题 Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdb的相关文章

Loading class `com.mysql.jdbc.Driver&#39;. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver&#39;.

在连接数据库时,使用了最新版本的mysql-Connector,所以导致老版本的"com.mysql.jdbc.Drive"不可行,要改为"com.mysql.cj.jdbc.Driver" Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. 原文地址:https://www.cnblogs.com

解决Loading class `com.mysql.jdbc.Driver&#39;. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver&#39;.

异常: 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=

使用springboot最新版本mysql-Connector连接数据库时提示Loading class `com.mysql.jdbc.Driver&#39;. This is deprecated.

在连接数据库时,使用了最新版本的mysql-Connector,即6.0以上版本 1.报错如下: 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

Loading class `com.mysql.jdbc.Driver&#39;. This is deprecated. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.

简单介绍 声明:使用JDK9.MYSQL8.idea 报错处理 报错信息如下 原因 提示信息表明数据库驱动com.mysql.jdbc.Driver已经被弃用了.应当使用新的驱动com.mysql.cj.jdbc.Driver Loading class `com.mysql.jdbc.Driver'. This is deprecated. The driver is automatically registered via the SPI and manual loading of the

MySQL Connector/J is the official JDBC driver for MySQL

mysql-connector-java-5.0.8.zip          mysql的jdbc驱动(MySQL Connector/J is the official JDBC driver for MySQL.)     http://dev.mysql.com/downloads/file.php?id=13598 zip压缩文件放在百度云:http://pan.baidu.com/disk/home#from=share_pan_logo 解压后得到mysql-connector-j

Mysql学习之十二:JDBC连接数据库之DriverManager方法

JDBC连接数据库 ?创建一个以JDBC连接数据库的程序,包含7个步骤: 1.加载JDBC驱动程序: 在连接数据库之前,首先要加载想要连接的数据库的驱动到JVM(Java虚拟机), 这通过java.lang.Class类的静态方法forName(String  className)实现. 例如: try{ //加载MySql的驱动类 Class.forName("com.mysql.jdbc.Driver") ; }catch(ClassNotFoundException e){ Sy

虚拟机中MySQL连接问题:Lost connection to MySQL server at &#39;reading initial communication packet, system error: 0 以及 host is not allowed to connect mysql

环境:在VirtualBox中安装了Ubuntu虚拟机,网络使用了NAT模式,开启了端口转发. 局域网内其他计算机访问虚拟机中的MySQL Server出现两个问题: Lost connection to MySQL server at 'reading initial communication packet, system error: 0 以及 host is not allowed to connect mysql 1.解决Lost connection to MySQL server

Win 7 mysql安装错误(the security settings could not be applied to the database (error 1045 MySQL)

安装MYSQL最后一步"Apply security setting"出现如下错误: The security settings could not be applied to the database because the connection has failed with the following error. Error Nr. 1045 Access denied for user 'root'@'localhost' (using password: YES) If a

远程mysql出现ERROR 1130 (HY000): Host &#39;172.17.42.1&#39; is not allowed to connect to this MySQL server

ERROR 1130: Host ***.***.***.*** is not allowed to connect to this MySQL server 说明所连接的用户帐号没有远程连接的权限,只能在本机(localhost)登录. 需更改 mysql 数据库里的 user表里的 host项 把localhost改称% 具体步骤:登陆到MySQL 首先 use mysql: 按照别人提供的方式update的时候,出现错误. MySQL> update user set host='%' w