- 關(guān)閉 mysql 服務(wù)
- 運行 mysqld --console --skip-grant-tables --shared-memory
- 打開一個新的命令窗口
- 運行 mysql -uroot
- 運行 update mysql.user set authentication_string='' where user='root' and host='localhost'
- 開啟mysql服務(wù)
密碼已經(jīng)被清空,如需設(shè)置新密碼蛾默,執(zhí)行 alter user user() identified by '此處輸入要設(shè)置的新密碼'
note: 以管理員身份運行