MYSQL更换密码

MYSQL5.7以下版本的数据库密码使用的是

mysql这个数据库里的user表的password这个字段,

修改密码只需:

1.update MySQL.user set password=password('root') where user='root' ;
2.flush privileges;
可是到了5.7版本,user表里就没有了password这个字段了,

要想修改密码则需要用authentication_string这个字段:

1.update MySQL.user set 

authentication_string=password('root') where user='root';

2.flush privileges;

posted @ 2018-04-17 17:10  天国的恩赐  阅读(149)  评论(0编辑  收藏  举报