首頁  >  文章  >  資料庫  >  Win7下mysql root帳號登入提示:ERROR 1045 (28000)解決方案

Win7下mysql root帳號登入提示:ERROR 1045 (28000)解決方案

PHPz
PHPz原創
2017-03-12 13:49:121732瀏覽

原文標題:Win7下mysql root帳號登入提示:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)解決方案

ERROR 1045 (28000): Ac…… password: YES)這個意思是密碼不正確#,那就修改密碼:

如果你是伺服器是 windows xp/2000/2003 /nt 都可以使用這個方法來找回遺失 MYSQL超級管理員root的密碼

如果施#win7 win vista,mysql 5.1##後的版本中好像沒有mysqld-nt.exe,則直接利用mysqld.exe來代替即可。 1
,停止MYSQL服務,CMD開啟DOS視窗(win7#、winVista#右鍵用管理員帳號執行),輸入
net stop mysql

Win7下mysql root帳號登入提示:ERROR 1045 (28000)解決方案

2#,在CMD命令列窗口,進入MYSQL安裝目錄#例如C: \Program Files\MySQL\MySQL Server 5.1\bin

方法:cd\ 按下enter後輸入:

Win7下mysql root帳號登入提示:ERROR 1045 (28000)解決方案

#cd C:\Program Files\MySQL\MySQL Server 5.1\bin

3,進入mysql 安全模式,即當##mysql

起來後,不用輸入密碼就能進入資料庫。

#指令為: mysqld-nt --skip-grant-tables
(win7
好像有錯,我沒管直接跳過,)4#,重新開啟一個CMD命令列窗口,進入...\bin下,,輸入
mysql -uroot -p,使用空密碼的方式登入

MySQLWin7下mysql root帳號登入提示:ERROR 1045 (28000)解決方案

(不用輸入密碼,直接按回車)


 5,輸入以下指令開始修改root使用者的密碼(注意:指令中mysql.user中間有個
  mysql> update mysql.user set password=PASSWORD('

### #新密碼############') where User='root';#######

Win7下mysql root帳號登入提示:ERROR 1045 (28000)解決方案

6, refresh the permission table
mysql> flush privileges;
7
, quit

#mysql> quit

Win7下mysql root帳號登入提示:ERROR 1045 (28000)解決方案

This wayMYSQLSuper administrator account ROOT has been reset, next End it in the task manager mysql-nt.exe This process, restartMYSQL! (You can also restart the server directly) MYSQL
After restarting, you can use the newly set ROOT Password loginMYSQL
!

以上是Win7下mysql root帳號登入提示:ERROR 1045 (28000)解決方案的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn