mysql-8.0.11-winx64更改密码 提示ERROR 1396 (HY000)错误解决

时间:2022-09-19 21:13:16

root初始密码指定为root后,安装Mysql Front无法登入,网上很多资料提示改一下root的密码就ok,发现8.0.11更改密码方法有变。

先用初始密码登入Mysql。

mysql> use mysql ;

mysql> selectuser,host from user ;

列示出root帐户对应的host与其它不同

+---------------------------+-----------+

|user                            | host      |

+---------------------------+-----------+

|root                           | %        |

|jack                           | localhost |

|mysql.infoschema  | localhost |

|mysql.session          | localhost |

|mysql.sys                  | localhost |

+---------------------------+-----------+

于是必密指令为:

mysql> ALTER USER'root'@'%'IDENTIFIED WITH mysql_native_password BY 'password';

mysql> FLUSHPRIVILEGES;

成功将root密码改成为password。

再登入Mysql Front正常!!!