无法 加载 身份验证 插件 ' caching_sha2_password' [英] Unable to load authentication plugin 'caching_sha2_password'

查看:98
本文介绍了无法 加载 身份验证 插件 ' 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

  1. 以root用户身份登录到您的MYSQL控制台,如下所示.

例如mysql -u YOUR_ROOT_USER_NAME -p YOUR_ROOT_USER_PASSWORD

  1. 然后通过替换YOUR_ROOT_USER_NAMEYOUR_ROOT_USER_PASSWORD
  2. 执行命令
  1. Then execute the command by replacing YOUR_ROOT_USER_NAME and YOUR_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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆