我使用MYSQL-FRONT這個工具更改了root用戶的密碼,當時是更改成功了,但是重啟MySQL后發現新密碼和老密碼都不能登錄了,數據庫再也進不去了,有誰遇到過這種情況,請幫忙看下。要求不重裝MySQL搞定。[email protected]我按照你的回答進行到第5步的時候mysqladmin -u root flush-privileges password "newpassword" 出現如下錯誤mysqladmin: unable to change password; error: 'Can't find any matching row in the user table'
1 回答

犯罪嫌疑人X
TA貢獻2080條經驗 獲得超4個贊
1.用系統管理員登陸系統。
2.停止MySQL的服務。
3.進入命令窗口,然后進入MySQL的安裝目錄,比如我的安裝目錄是c:mysql,進入C:mysqlbin
4.跳過權限檢查啟動MySQL,
c:mysqlbin>mysqld-nt --skip-grant-tables
5.重新打開一個窗口 mysql 直接進入數據庫。
6 切換數據庫 use mysql
7 update user set password =password('newpass') where user= 'root' and host = 'localhost'
select * from user; 如果沒有看到root,執行grant all pivileges on *.* to 'root'@'localhost' indentifed by '密碼’;
8 flush privileges;
9 重啟mysql
10 mysql -uroot -p 你的新密碼
添加回答
舉報
0/150
提交
取消