1. 管理员权限运行命令提示符,登陆MySQL mysql -u root -p password 2. 修改账户密码加密规则并更新用户密码 ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER; #修改加密规则 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'; #更新一下用
1.通过命令 select user,plugin from user where user='root'; 我们可以发现加密方式是caching_sha2_password. 2. 修改查看加密方式alter user 'root'@'%' identified with mysql_native_password by 'your password';your password这里填自己的mysql密码 3. my.cnf文件添加: default_authentication_plugi