解决办法
Microsoft Windows [版本 10.0.22000.184]
© Microsoft Corporation。保留所有权利。
D:\mysql-8.0.33-winx64\bin>mysql -uroot -p
Enter password: ********** 这里输入之前安装msyql留下的随机过期密码我的是:E!sG:f&yn9qG
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 8.0.33
Copyright © 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> alter user ‘root’@‘localhost’ identified by ‘654321’;
Query OK, 0 rows affected (1.84 sec)
mysql> alter user ‘root’@'localhost’password expire never;
Query OK, 0 rows affected (0.12 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.02 sec)**