修改mysql5.7版本的用户密码

update user set authentication_string=password('xxx') where user='root' and host='localhost';
flush privileges;

 

 也可以不加上and host='localhost',这样的话,会把root的密码全改为xxx。

先通过命令行,连上数据库,然后use mysql;

posted @ 2020-12-15 10:08  jiduoduo  阅读(185)  评论(0)    收藏  举报