mysql破解root用户密码总结

 


方法一:


1、
  /etc/my.cnf
  在[mysqld]段中加入
  skip-grant-table
2、
  重启mysql
3、
  直接mysql登录
4、
  通过修改权限表方式修改mysql密码(update)

  update mysql.user set password=password('xxxx') where user='root'and host='localhost';
5、
  去除my.cnf中skip-grant-table
6、
  重启mysql
7、
  使用新密码登录

 

方法二:


  窗口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



posted @ 2016-12-17 13:14  xuanhui  阅读(368)  评论(0编辑  收藏  举报