当前位置: 代码迷 >> 综合 >> 远程连接mysql8.0,Error No.2058 Plugin caching_sha2_password could not be loaded(本人亲测可用)
  详细解决方案

远程连接mysql8.0,Error No.2058 Plugin caching_sha2_password could not be loaded(本人亲测可用)

热度:25   发布时间:2024-02-13 05:28:38.0

通过本地去连接远程的mysql时报错,原因时mysql8.0的加密方法变了。

mysql8.0默认采用caching_sha2_password的加密方式

第三方客户端基本都不支持这种加密方式,只有自带的命令行支持

所以需要修改加密方式。

首先进入mysql命令行

[root@localhost ~]# mysql -u root -p

第一步:修改加密方式

ALTER USER'root'@'localhost' IDENTIFIED BY 'Qigaoxiang2018@' PASSWORD EXPIRE NEVER;

第二步:重新修改密码

ALTER USER'root'@'%' IDENTIFIED WITH mysql_native_password BY 'Qigaoxiang2018@';

第三步:刷新(不做可能无法生效)

FLUSH PRIVILEGES;

之后可以成功连接。(本人亲测可用)

  相关解决方案