破解本地的mysql用戶名和密碼
Windows: 1.用系統(tǒng)管理員登陸系統(tǒng)。 2.停止MySQL的服務(wù)。 3.進(jìn)入命令窗口,然后進(jìn)入MySQL的安裝目錄,比如我的安裝目錄是c:\mysql,進(jìn)入C:\mysql\bin 4.跳過權(quán)限檢查啟動(dòng)MySQL, c:\mysql\bin>mysqld-nt --skip-grant-tables 5.重新打開一個(gè)窗口,進(jìn)入c:\mysql\bin目錄,設(shè)置root的新密碼 c:\mysql\bin>mysqladmin -u root flush-privileges password "newpassword" c:\mysql\bin>mysqladmin -u root -p shutdown 將newpassword替換為你要用的root的密碼,第二個(gè)命令會(huì)提示你輸入新密碼,重復(fù)第一個(gè)命令輸入的密碼。 6.停止MySQL Server,用正常模式啟動(dòng)Mysql 7.你可以用新的密碼鏈接到Mysql了。 Unix&Linux: 1.用root或者運(yùn)行mysqld的用戶登錄系統(tǒng); 2.利用kill命令結(jié)束掉mysqld的進(jìn)程; 3.使用--skip-grant-tables參數(shù)啟動(dòng)MySQL Server shell>mysqld_safe --skip-grant-tables & 4.為root@localhost設(shè)置新密碼 shell>mysqladmin -u root flush-privileges password "newpassword"5.重啟MySQL Server |
posted on 2007-09-21 11:26 gembin 閱讀(1517) 評(píng)論(3) 編輯 收藏