前言:docker装了个mysql容器,连接是后报错2059

参考博文: https://blog.csdn.net/ora_dy/article/details/80251487

mysql版本是8.0.12

这是由于新版本的的密码加密特性不一样引起的,8之前的版本用的是mysql_native_password,这个版本用的是caching_sha2_password

select Host,User,plugin from mysql.user;

+-----------+------------------+-----------------------+
| Host | User | plugin |
+-----------+------------------+-----------------------+
| % | root | caching_sha2_password |

解决方法:将加密方式改成老版本的方式即可

ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '密码';

[mysqld]

default_authentication_plugin=mysql_native_password

相关文章:

  • 2022-12-23
  • 2021-09-20
  • 2021-08-31
  • 2022-01-21
  • 2022-02-19
  • 2022-12-23
  • 2022-12-23
  • 2022-01-05
猜你喜欢
  • 2021-08-17
  • 2022-12-23
  • 2021-04-05
  • 2021-07-14
  • 2021-06-10
  • 2021-08-25
  • 2022-12-23
相关资源
相似解决方案