使用使用MySql8.0.1与mysql-connector-java-8.0.12.jar的驱动出现的错误
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.
Sat Sep 01 01:21:58 CST 2018 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Sat Sep 01 01:21:59 CST 2018 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
主要原因是8.0的驱动方式有所改变。
问题:
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'.
解决方法:
使用Mysql8.0.1的驱动方式是:com.mysql.cj.jdbc.Driver
使用Mysql5.7.19的驱动方式是:com.mysql.jdbc.Driver
本文解决了使用MySql8.0.1与mysql-connector-java-8.0.12.jar驱动时出现的警告信息问题。主要介绍了如何从旧版驱动com.mysql.jdbc.Driver更新到新版com.mysql.cj.jdbc.Driver。
2481





