mysql root密码破解

 

破解root密码:
方法一:
1、
/etc/my.cnf
在[mysqld]段中加入
skip-grant-table
2、
重启mysql
3、
直接mysql登录
3、
通过修改权限表方式修改mysql密码(update)
4、
去除my.cnf中skip-grant-table
5、
重启mysql
6、
使用新密码登录

-------------------------------

方法二:
窗口1:
1、停止mysql
2、mysqld_safe --skip-grant-table
窗口2:
1、直接mysql进入
mysql> update mysql.user set password=password('123456') where user='root' and host='localhost';
mysql> flush privileges;

窗口1:
启动mysql

 

-----------------------------

mysql5.6修改密码时有坑(需要谨慎)

 

posted @ 2016-09-13 23:35  xuanhui  阅读(149)  评论(0编辑  收藏  举报