Mysql报错:ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

1.报错

mysql> alter user 'root'@'server5' identified by 'root';
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

我使用改密码结果遇到“需重置密码的错误”,内心也是很尴尬。。。

2.原因

在寻找。。。

3.解决办法

多尝试几次其它的改密命令,如下:

mysql> set password=password("root");
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)