一、问题描述
链接数据库时出现以下问题
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这一个加载项被弃用了。
二、解决方法
根据提示The new driver class is `com.mysql.cj.jdbc.Driver'.把原先的加载项换为com.mysql.cj.jdbc.Driver即可
三、链接数据库时出现登录数据库的客户端跟mysql8.0不兼容
原因是因为mysql8.0的密码认证采用了新的密码格式
解决方法:
1.进入数据库
2.输入代码
alter user'root' @' localhost' IDENTIFIED WITH mysql_native_password BY '数据库密码';
FLUSH PRIVILECES;