mysql8.0版本一登录无论输入什么命令都报错

mysql> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this 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 “26SE>Z%UddNN”;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '“26SE>Z%UddNN”' at line 1

要求第一次登陆时重置密码,正确语法是:

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'root123';
Query OK, 0 rows affected (0.01 sec)

再刷新一下

FLUSH PRIVILEGES; 
posted @ 2022-04-07 21:30  下个ID见  阅读(108)  评论(0)    收藏  举报