MySQL ERROR 1133 (42000): Can’t find any matching row in the user table

2019-10-0808:57:13 评论 15

0x01 问题描述

在使用 mysql 以下命令修改用户密码的时候出现这个错误:ERROR 1133 (42000): Can't find any matching row in the user tabl.从字面上的意思是在用户标签中找不到匹配的行;

set password for mysqlroot@localhost = password ('123456');

MySQL ERROR 1133 (42000): Can't find any matching row in the user table

0x02 解决方法

我们登录到 mysql 查询下 mysql 用户的相关信息;

mysql -uroot -p
Enter password: ************
select Host,User from user;

MySQL ERROR 1133 (42000): Can't find any matching row in the user table

从列出的用户信息可以看到列出的用户和 host,修改命令即可;

set password for mysqlroot@localhost = password ('123456');    # 原报错命令;
set password for mysqlroot@'%' = password ('123456');     # 修改 localhost 为 % 密码修改搞定;

MySQL ERROR 1133 (42000): Can't find any matching row in the user table

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: