mysql 8.0以上版本用户密码修改
- MySQL
- 2020-07-28
- 19热度
- 0评论
执行以下命令:
mysql -uroot -p
use mysql;
update user set authentication_string='' where user='root'; //将 authentication_string 置空
alter user 'root'@'%' identified by 'newpassword';
flush privileges;
注:在 mysql 8.0 以上版本这两条命令已经不起作用了:
1、update mysql.user set password='newpassword' where user='root';
2、update mysql.user set password=PASSWORD('newpassword') where User='root';

鲁ICP备19063141号
鲁公网安备 37010302000824号