mysql 问题 Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is
Posted panchanggui
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql 问题 Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is 相关的知识,希望对你有一定的参考价值。
异常错误: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 的主要内容,如果未能解决你的问题,请参考以下文章
Mysql开发实践:error while loading shared libraries: libaio解决方案
mysql 问题 Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is
mysql无法初始化 报错 error while loading shared libraries: libaio.so.1
mysql: error while loading shared libraries: libmysqlclient