mysql 忘記了root的密碼(linux下解決方案,window同理),mysqlroot

來源:互聯網
上載者:User

mysql 忘記了root的密碼(linux下解決方案,window同理),mysqlroot

mysql 忘記了root的密碼的時候的解決步驟,

1: cd /etc/mysql/(進入mysql的配置目錄) 

2:vim my.cnf \skip-grant-tables(進入mysql的設定檔,在設定檔中加入跳過“授權表”的命令)

3:/etc/init.d/apache restart(重啟mysql就可以了) 

4:命令列輸入mysql(直接進入資料庫)

 5:然後進入mysql->user->(update user set Passwrod=PASSWORD("123456") where User="root") 

6:然後把skip-grant-tables注釋掉

著作權聲明:本文為博主原創文章,未經博主允許不得轉載。

相關文章

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.