mysql8以上忘記root密碼

1.net stop mysql_server 先關掉系統服務

2.mysqld --console --skip-grant-tables --shared-memory

5586699ddfedab5ec010798a79930383.jpeg-wh_600x-s_3308372458.jpeg

3.重新打開一個cmd,進入bin目錄 mysql.exe -u root  可以以空密碼的形式登錄到mysql中

4.UPDATE mysql.user SET authentication_string='' WHERE user='root' and host='localhost';執行腳本修改密碼

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章