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

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

(0)
公众号 微信扫一扫关注公众号 微信扫一扫关注公众号
上一篇 2019年10月7日 08:14
下一篇 2019年10月9日 08:30

相关推荐

网站正在改版,数据在陆续恢复中。