- 工信部備案號 滇ICP備05000110號-1
- 滇公安備案 滇53010302000111
- 增值電信業(yè)務(wù)經(jīng)營許可證 B1.B2-20181647、滇B1.B2-20190004
- 云南互聯(lián)網(wǎng)協(xié)會理事單位
- 安全聯(lián)盟認(rèn)證網(wǎng)站身份V標(biāo)記
- 域名注冊服務(wù)機(jī)構(gòu)許可:滇D3-20230001
- 代理域名注冊服務(wù)機(jī)構(gòu):新網(wǎng)數(shù)碼
操作系統(tǒng):WINDOWS-XP 系統(tǒng)
數(shù)據(jù)庫版本:mysql 5.x
提示:access denied for user 'root'@'localhost' using password yes/no
原來都好好的,今天開機(jī)上來提示上面的這個錯誤,重啟 MySQL 還是不可以。
注意我這里的環(huán)境是 WINDOWS-XP 系統(tǒng),LINUX 系統(tǒng)下的操作沒有驗證過,情況不清楚。
1. 管理員登陸系統(tǒng),停止 MySQL 服務(wù)或者結(jié)束 MySQL 進(jìn)程。
2. 啟動 WINDOWS 的命令行窗口(即通常的 DOS 窗口:運(yùn)行cmd),切換到你的 “MySQLin” 目錄下。
例如我的是 “D:Program FilesMySQLMySQL Server 5.2in”,然后執(zhí)行下面的粗體的命令:(注意你的 “my.ini” 位置)
Microsoft Windows XP [版本 5.1.2600]
(C) 版權(quán)所有 1985-2001 Microsoft Corp.
C:Documents and SettingsAdministrator>cd D:Program FilesMySQLMySQL Server 5.2in
C:Documents and SettingsAdministrator>d:
D:Program FilesMySQLMySQL Server 5.2in>mysqld --defaults-file="D:Program FilesMySQLMySQL Server 5.2my.ini" --console --skip-grant-tables100608 9:04:12 InnoDB: Started; log sequence number 0 46409
100608 9:04:12 [Note] mysqld: ready for connections.
Version: '5.2.0-falcon-alpha-community' socket: '' port: 3306 MySQL Community
Server (GPL)
100608 9:06:57 [Warning] Found invalid password for user: 'root@localhost'; Ign
oring user
只要出現(xiàn)上面信息,就說明 MySQL 已經(jīng)起來了。
3. 不關(guān)閉此命令行窗口,重新打開一個命令行窗口,同樣切到 “MySQLin” 目錄下,然后執(zhí)行下面的粗體的命令:
Microsoft Windows XP [版本 5.1.2600]
(C) 版權(quán)所有 1985-2001 Microsoft Corp.
C:Documents and SettingsAdministrator>cd D:Program FilesMySQLMySQL Server 5.2in
C:Documents and SettingsAdministrator>d:
D:Program FilesMySQLMySQL Server 5.2in>mysql -u root mysql
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 1
Server version: 5.2.0-falcon-alpha-community MySQL Community Server (GPL)
Type 'help;' or 'h' for help. Type 'c' to clear the buffer.
然后,就是重新設(shè)置密碼了!
mysql> update user SET Password=PASSWord('root') where USER='root';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye
4. 好了到此步,可以關(guān)閉第一個 DOS 窗口了(關(guān)閉服務(wù))。打開系統(tǒng)服務(wù)控制窗口(控制面板--管理工具--服務(wù)),啟動 MySQL 服務(wù)。
5. 在剩下的第二個 DOS 窗口中,用新的 ROOT 密碼連接 MySQL。
D:Program FilesMySQLMySQL Server 5.2in>mysql -u root -p
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 1
Server version: 5.2.0-falcon-alpha-community-nt MySQL Community Server (GPL)
Type 'help;' or 'h' for help. Type 'c' to clear the buffer.
mysql> quit
Bye
至此,系統(tǒng)恢復(fù) ROOT 用戶管理權(quán)限完成,就是管理員密碼的問題
提交成功!非常感謝您的反饋,我們會繼續(xù)努力做到更好!
這條文檔是否有幫助解決問題?
售前咨詢
售后咨詢
備案咨詢
二維碼
TOP