mysql报错:You must reset your password using ALTER USER statement before executing this statement.

凉夜lrs

关注

阅读 80

2023-10-14

新安装mysql后,登录后,执行任何命令都会报错:You must reset your password using ALTER USER statement before executing this statement.

mysql报错:You must reset your password using ALTER USER statement before executing this statement._ide

【解决办法】

MySQL版本5.7.6版本以前用户可以使用如下命令:

mysql> SET PASSWORD = PASSWORD('Admin2022!');

MySQL版本5.7.6版本开始的用户可以使用如下命令:

mysql> alter user 'root'@'localhost' identified by '123456';

执行报错,修改语句如下:

mysql> ALTER USER USER() IDENTIFIED BY '123456';

执行成功

精彩评论(0)

0 0 举报