安装完mysql5.7.26重置密码

进入mysql 数据库输入

mysql> update mysql.user set authentication_string=password('XXXXXX') where user='root' and Host = 'localhost'

报错

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

解决办法:

mysql> alter user user() identified by "123456";
Query OK, 0 rows affected (0.00 sec)

你可能感兴趣的:(mysql)