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

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

1、問題描述

使用set password for 'root'@'localhost'=password('MyNewPass4!'); 命令修改mysql數據庫root用戶密碼提示ERROR 1133 (42000): Can't find any matching row in the user table錯誤

2、主要原因

  • 錯誤提示的字面意思:在用戶表中找不到任何匹配的行

  • 登錄mysql執行以下命令

use mysql;
select Host,User from user;

這裏寫圖片描述

主要原因是修改密碼的條件不否

3、解決辦法

  • set password for 'root'@'localhost'=password('MyNewPass4!'); 代碼中的localhost修改%,與數據庫Host字段值一致
set password for 'root'@'%'=password('MyNewPass4!');
  • 刷新
flush privileges;

這裏寫圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章