解决Unable to load authentication plugin ‘caching_sha2_password‘

连接Mysql8时报错:

java.sql.SQLException: Unable to load authentication plugin 'caching_sha2_password'.

原因

不同版本的认证插件不同造成的
8版本前是:default_authentication_plugin=mysql_native_password
8版本后是:default_authentication_plugin=caching_sha2_password

解决办法

更新认证plugin
既然mysql8默认的认证插件是caching_sha2_password` ,那我们就同步 更新驱动即可

<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>8.0.29</version>
</dependency>

亲测解决问题。

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/u011019141/article/details/131940472