MYSQL设置密码时显示Failed! Error: SET PASSWORD has no significance for user 'root'@'localhost' as the authentication method used doesn't store authentication d

发布时间 2023-05-23 18:15:03作者: Booker003

 用这个命令进入mysql

sudo mysql


在sql命令行输入以下命令回车,你就可以把密码改成mynewpassword

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'mynewpassword';


exit回到终端命令行,输入:

sudo mysql_secure_installation


输入刚才的密码即可。
出现的问题都选n.