1、点击开始->运行,输入cmd打开dos命令窗口;
修复python连接MySQL8.0.15数据库2059报错
2、输入cd C:\Program Files\MySQL\MySQL Server 8.0\bin命令切换到MySQL安装目录下的bin目录;
3、输入 mysql -u root -p 根据提示输入数据库密码;
修复python连接MySQL8.0.15数据库2059报错
4、执行命令:
use mysql;
select user,plugin from user where user=‘root’;
可以看到当前用户的加密方式为caching_sha2_password
修复python连接MySQL8.0.15数据库2059报错
5、执行命令:
alter user ‘root’@‘localhost’ identified with mysql_native_password by ‘password’;
将用户的加密方式改为mysql_native_password
6、执行命令:
select user,plugin from user where user=‘root’;
可以看到当前用户的加密方式更新为mysql_native_password
修复python连接MySQL8.0.15数据库2059报错
7、执行命令:
flush privileges;
使权限配置项立即生效。

相关文章:

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