<分区>
我遇到了错误
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 中建立连接。
<分区>
我遇到了错误
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 中建立连接。
最佳答案
较新版本的 MySQL 默认为 caching_sha2_password。如果您想禁用它,请按照以下步骤操作
eg
mysql -u YOUR_ROOT_USER_NAME -p YOUR_ROOT_USER_PASSWORD
YOUR_ROOT_USER_NAME
和 YOUR_ROOT_USER_PASSWORD
来执行命令>
ALTER USER 'YOUR_ROOT_USER_NAME'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YOUR_ROOT_USER_PASSWORD'
;
在此之后为任何客户端连接时,您将不会再遇到任何“caching_sha2_password
”异常。
关于java - 无法加载身份验证插件 'caching_sha2_password',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50193771/