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-01-04 17:41  流年如水烟雨随风  阅读(233)  评论(0编辑  收藏  举报