MySQL源码编译:You must reset your password using ALTER USER statement before executing this statement.

MySQL5.7.43版本,源码编译,客户端登录执行错误记录
首次登录,需要把自动生成的密码重置

# mysql -h localhost -u root -P3306 -pYhinh/6KEyZu
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.43-debug

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> alter user user() identified by '12345678';
Query OK, 0 rows affected (0.00 sec)

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

mysql>

自己的服务器测试,密码简单点

 alter user user() identified by '12345678';

你可能感兴趣的:(mysql,数据库)