天天看點

windwows和linux下,mysql密碼的破解

MySQL密碼破解

1、首先停止正在運作的MySQL程序 

Linux下,運作 killall -TERM mysqld 

Windows下,如果寫成服務的 可以運作:net stop mysql,如未加載為服務,可直接在程序管理器中進行關閉。 

2、以安全模式啟動MySQL 

Linux下,運作 /usr/local/mysql/bin/mysqld_safe --skip-grant-tables & 

Windows下,在指令行下運作 X:/MySQL/bin/mysqld-nt.exe --skip-grant-tables 

3、完成以後就可以不用密碼進入MySQL了 

Linux下,運作 /usr/local/mysql/bin/mysql -u root -p 進入 

Windows下,運作 X:/MySQL/bin/mysql -u root -p 進入 

4、更改密碼 

>use mysql

>update mysql.user set password=password("新密碼") where user="root"; 

>flush privileges; 

本文轉自 gehailong 51CTO部落格,原文連結:http://blog.51cto.com/gehailong/264165,如需轉載請自行聯系原作者

繼續閱讀