mysql密碼忘了

來源:互聯網
上載者:User

標籤:sans   rda   運行   認證   輸入   flush   mysql5.7   orm   where   

1. 關閉正在啟動並執行MySQL服務
2. 開啟DOS視窗,轉到mysql\bin目錄
3. 輸入mysqld --skip-grant-tables 斷行符號       --skip-grant-tables 的意思是啟動MySQL服務的時候跳過許可權表認證
4. 再開一個DOS視窗(因為剛才那個DOS視窗已經不能動了),轉到mysql\bin目錄 
5. 輸入mysql斷行符號,如果成功,將出現MySQL提示符 >
6. 串連許可權資料庫: use mysql;
6. 改密碼:update user set password=password("root") where user="root"; 
   mysql5.7以上版本-->    UPDATE user SET authentication_string=PASSWORD("root") WHERE User="root";
7. 重新整理許可權(必須步驟):flush privileges; 
8. 退出 quit。 
9. 登出系統,再進入,使用使用者名稱root和剛才設定的新密碼123登入。

mysql密碼忘了

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.