mysql8连接错误(2059 authentication plugin 'caching_sha2_pawwsord' cannot be loaded)

在我安装好mysql8以后看服务也启动了,结果一直连接不上,密码也是对的然后给我报这个错误:
mysql8连接错误(2059 authentication plugin 'caching_sha2_pawwsord' cannot be loaded)

后面的乱码可以不用管,错误的大概意思应该是:无法加载身份验证插件’caching_sha2_password”

解决方式:

  1. 我们打开 MySQL 8.0 Command Line Client - Unicode
    mysql8连接错误(2059 authentication plugin 'caching_sha2_pawwsord' cannot be loaded)

  2. 启动 MySQL 8.0 Command Line Client - Unicode

  3. 输入密码

  4. mysql8连接错误(2059 authentication plugin 'caching_sha2_pawwsord' cannot be loaded)
    5.密码输入完成后输入如下命令:
    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
    看到Query OK, 0 rows affected (0.02 sec)表示修改完成
    再重新连接数据库,连接成功!