解决如下:
打开mysql输入如下命令:
1、use mysql;
2、alter user ‘root’@‘localhost’ identified with mysql_native_password by ‘abcdt’;
alter user ‘root’@‘localhost’ identified with mysql_native_password by ‘1234’;
3、flush privileges;
链接: link.
.
也使用于linux
2059 - Authentication plugin ‘caching_sha2_password‘ cannot be loaded:报错的解决办法
Linux的mysql基本操作
mysql -u root -p -h 127.0.0.1
#登录
mysql -uroot -ppassword
#选择数据库
use mysql;
注意:如果是远程连接,请将’localhost’换成’%’
ALTER USER ‘root’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘你的数据库密码’;
#刷新权限
FLUSH PRIVILEGES;