1、连接MySQL报错Unable to load authentication plugin ‘caching_sha2_password’,错误信息如下:
java.sql.SQLException: Unable to load authentication plugin 'caching_sha2_password'.
这是因为MySQL在8.0后验证方式由mysql_native_password变为caching_sha2_password,所以连接时会报这个错,解决办法如下:
在命令行输入
alter user root@localhost identified with mysql_native_password by 'password';