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;

转载于:https://www.cnblogs.com/ShawnYang/p/8194664.html

你可能感兴趣的:(mysql 修改数据库密码)