After the MySQL root account password is set to "root", the command prompt ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

After modifying the root account password to "root", it will prompt ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

MySQL5.7 strengthens the security protection, the above means that the password does not meet the security policy requirements, we enter a more complex password of 8 digits or more

mysql> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

You can change the password with the following command:

alter user 'root'@'localhost' identified by 'xiaxiaoxu';
mysql> alter user 'root'@'localhost' identified by 'xiaxiaoxu';
Query OK, 0 rows affected (0.00 sec)

There will be no problem after running it again

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00 sec)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325115379&siteId=291194637