破解Mysql密码

Posted on 2021-08-06 10:52  -=-  阅读(191)  评论(0)    收藏  举报

1、 关闭Mysql

2、进入/etc/my.cnf 添加skip-grant-tables

3、进入Mysql

4、use mysql-->update mysql.user set authentication_string=password('root_password') where user='root';修改密码(root_password')

5、退出Mysql,进入/etc/my.cnf 注释skip-grant-tables