破解MySQL密码
1.使用mysqladmin修改mysql密碼
C:\>mysqladmin -udbuser -p password newpass
Enter password: oldpass
當然用此命令的前提是你把mysql加入了環境變量,如果沒有加入環境變量的話那只能在命令行下cd到mysqladmin所在的目錄下與此那個次命令了!
-----------------------------------------
2.重置root密碼
方法一:
在my.ini或/etc/my.cnf的[mysqld]字段加入:
skip-grant-tables
重啟mysql服務,這時的mysql不需要密碼即可登錄數據庫
然后進入mysql
mysql>use mysql;
mysql>update user set password=password('新密碼') WHERE User='root';
mysql>flush privileges;
運行之后最后去掉my.ini或/etc/my.cnf中的skip-grant-tables,重啟mysqld即可。
?
?
?
?
總結
- 上一篇: SQL中left join、right
- 下一篇: linux cmake编译源码,linu