winxp 安裝MYSQL 出現(xiàn)Error 1045 access denied 的解決方法
更新時間:2010年07月10日 01:54:57 作者:
自己遇到了這個問題,也找了很久才解決,就整理一下,希望對大家有幫助!
操作系統(tǒng):WINDOWS-XP 系統(tǒng)
提示:access denied for user 'root'@'localhost' using password yes/no
原來都好好的,今天開機上來提示上面的這個錯誤,重啟 MySQL 還是不可以。
注意我這里的環(huán)境是 WINDOWS-XP 系統(tǒng),LINUX 系統(tǒng)下的操作沒有驗證過,情況不清楚。
1. 管理員登陸系統(tǒng),停止 MySQL 服務或者結束 MySQL 進程。
2. 啟動 WINDOWS 的命令行窗口(即通常的 DOS 窗口:運行cmd),切換到你的 “MySQL\bin” 目錄下。
例如我的是 “D:\Program Files\MySQL\MySQL Server 5.2\bin”,然后執(zhí)行下面的粗體的命令:(注意你的 “my.ini” 位置)
Microsoft Windows XP [版本 5.1.2600]
(C) 版權所有 1985-2001 Microsoft Corp.
C:\Documents and Settings\Administrator>cd D:\Program Files\MySQL\MySQL Server 5.2\bin
C:\Documents and Settings\Administrator>d:
D:\Program Files\MySQL\MySQL Server 5.2\bin>mysqld --defaults-file="D:\Program Files\MySQL\MySQL Server 5.2\my.ini" --console --skip-grant-tables
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. 不關閉此命令行窗口,重新打開一個命令行窗口,同樣切到 “MySQL\bin” 目錄下,然后執(zhí)行下面的粗體的命令:
Microsoft Windows XP [版本 5.1.2600]
(C) 版權所有 1985-2001 Microsoft Corp.
C:\Documents and Settings\Administrator>cd D:\Program Files\MySQL\MySQL Server 5.2\bin
C:\Documents and Settings\Administrator>d:
D:\Program Files\MySQL\MySQL Server 5.2\bin>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.
然后,就是重新設置密碼了!
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. 好了到此步,可以關閉第一個 DOS 窗口了(關閉服務)。打開系統(tǒng)服務控制窗口(控制面板--管理工具--服務),啟動 MySQL 服務。
5. 在剩下的第二個 DOS 窗口中,用新的 ROOT 密碼連接 MySQL。
D:\Program Files\MySQL\MySQL Server 5.2\bin>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)恢復 ROOT 用戶管理權限完成,就是管理員密碼的問題,奇怪,官方安裝的時候不給出解決方法,貌似已存在很久了。。。
您可能感興趣的文章:
- MYSQL ERROR 1045 (28000): Access denied for user (using password: YES)問題的解決
- mysql登錄報錯提示:ERROR 1045 (28000)的解決方法
- navicat連接mysql時出現(xiàn)1045錯誤的解決方法
- Mysql安裝 Navicat 出現(xiàn)1044/1045錯誤的解決方法
- MySql 安裝時的1045錯誤
- Windows下MySql錯誤代碼1045的解決方法
- MySQL ERROR 1045 (28000): Access denied for user ''root''@''localhost'' (using password: NO) 的原因分解決辦法
- mysql登錄遇到ERROR 1045問題解決方法
- 解決ubuntu 16.04安裝mysql5.7.17后,登錄時出現(xiàn)ERROR 1045 (28000): Access denied for user ''root''@''localhost''問題
- mysql數(shù)據(jù)庫中1045錯誤的解決方法
相關文章
擁有5星評級數(shù)據(jù)庫表結構 如何才能更高效的使用?
本篇文章介紹了,擁有5星評級數(shù)據(jù)庫表結構 如何才能更高效的使用的方法。需要的朋友參考下2013-04-04mysql 本地數(shù)據(jù)庫如何從遠程數(shù)據(jù)庫導數(shù)據(jù)
mysql 本地數(shù)據(jù)庫如何從遠程數(shù)據(jù)庫導數(shù)據(jù),本文以此問題進行詳細介紹,需要了解的朋友可以參考下2012-11-11windows server2014 安裝 Mysql Applying Security出錯的完美解決方法
這篇文章給大家介紹了windows server2014 安裝 Mysql Applying Security出錯的完美解決方法,造成這種問題的主要原因是因為安裝一遍之后沒有卸載干凈,要解決這個問題需要注意以下幾點,具體解決方法,大家參考下本文2017-07-07