--方法1
alter user 'root'@'localhost' identified by 'your password';
--方法2,需要已知password
mysqladmin -uroot -pold_password password net_password
--错误,user表中已经没有password字段
use mysql;
update user set password='pwd' where user='root';
--authentication_string不是密码字段
update mysql.user set authentication_string=password('root') where user='root';
--上句执行后警告,password()以后将移除
show warnings;
--'PASSWORD' is deprecated and will be removed in a future release.
mysql(5.7.17)修改密码
最新推荐文章于 2023-05-12 22:16:39 发布