无法 加载 身份验证 插件 ' caching_sha2_password' [英] Unable to load authentication plugin 'caching_sha2_password'
问题描述
我遇到错误
无法使用com.mysql.jdbc.Driver建立到jdbc:mysql://localhost:3306/world?zeroDateTimeBehavior = convertToNull的连接(无法加载身份验证插件'caching_sha2_password')
Cannot establish a connection to jdbc:mysql://localhost:3306/world?zeroDateTimeBehavior=convertToNull using com.mysql.jdbc.Driver (Unable to load authentication plugin 'caching_sha2_password'.)
在netbean中建立了连接.
in netbean established the connection.
推荐答案
MySQL的较新版本默认为caching_sha2_password.如果要禁用它,请按照以下步骤操作
The newer versions of MySQL default to caching_sha2_password. If you want to disable it then follow below steps
- 以root用户身份登录到您的MYSQL控制台,如下所示.
例如
mysql -u YOUR_ROOT_USER_NAME -p YOUR_ROOT_USER_PASSWORD
- 然后通过替换
YOUR_ROOT_USER_NAME
和YOUR_ROOT_USER_PASSWORD
执行命令
- Then execute the command by replacing
YOUR_ROOT_USER_NAME
andYOUR_ROOT_USER_PASSWORD
ALTER USER 'YOUR_ROOT_USER_NAME'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YOUR_ROOT_USER_PASSWORD'
;
ALTER USER 'YOUR_ROOT_USER_NAME'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YOUR_ROOT_USER_PASSWORD'
;
此后为任何客户端连接时,您将不再获得任何"caching_sha2_password
"异常.
You will no longer get any 'caching_sha2_password
' exception while connecting for any client after this.
这篇关于无法 加载 身份验证 插件 ' caching_sha2_password'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!