解決MySql 資料庫 提示:1045 access denied for user 'root'@'localhost' using password YES,mysqldenied

來源:互聯網
上載者:User

解決MySql 資料庫 提示:1045 access denied for user 'root'@'localhost' using password YES,mysqldenied

1. 開始 --> cmd   --> net stop mysql  (停用MySQL服務  沒啟動的可以省略)

2. 找到安裝路徑 MySQL Server 5.1下的my.ini

3. 開啟 my.ini  找到  [mysqld]  然後在下面加上

     這句: skip_grant_tables (意思好像是 啟動MySQL服務的時候跳過許可權表認證  )

4. 然後就啟動資料庫修改密碼了   

    開始 --> cmd   -->   net start mysql   (啟動MySQL服務)--->   mysql  斷行符號   (  如果成功,將出現MySQL提示符)

5. 輸入use mysql; (串連許可權資料庫)。

6. 改密碼:update user set password=password("123") where user="root";(別忘了最後加分號,5.7版本以前,5.7版本以後替換為password欄位替換為:authentication_string) 

7. 重新整理許可權(必須步驟):flush privileges; 。 

8. 退出 quit。 

9. 將第3 步的 my.ini裡的 skip_grant_tables  去掉(啟動MySQL服務的時候不能讓他跳過許可權表認證 )

10. 重啟MySQL ,再進入,使用使用者名稱root和剛才設定的新密碼123就可以登入了。 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.