Copyright (c) 2000, 2021, 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> use mysql
Database changed
mysql> ALTER USER 'gavin'@'localhost' IDENTIFIED BY '955945' PASSWORD EXPIRE NEVER;
ERROR 1396 (HY000): Operation ALTER USER failed for 'gavin'@'localhost'
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '955945' PASSWORD EXPIRE NEVER;
Query OK, 0 rows affected (0.01 sec)
mysql>
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '955945';
Query OK, 0 rows affected (0.02 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql> alter user 'root'@'localhost' identified by '955945';
Query OK, 0 rows affected (0.01 sec)
mysql>
一番操作之后就可以了;