【破解密码篇01】mysql数据库

破解mysql数据库密码


1.进入数据库主配置文件

[root@localhost ~]# vim  /etc/my.cnf

第五行 加入 skip-grant-tables
在这里插入图片描述
2.重启数据库服务

[root@localhost ~]#  systemctl  restart  mysqld

3.进入数据库

[root@localhost ~]#  mysql

-------------------5.7版本适合下面的命令----------------

mysql> use mysql;
mysql> update user set
      -> authentication_string=password('ABCabc@123') where user='root';
mysql> flush privileges;     //刷新
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'ABCabc@123';
mysql> \q     //退出数据库

4.重启数据库服务

[root@localhost ~]#  systemctl  restart  mysqld

5.进入数据库主配置文件

[root@localhost ~]# vim  /etc/my.cnf

skip-grant-tables 前面加注释
在这里插入图片描述
6.重启数据库服务

[root@localhost ~]#  systemctl  restart  mysqld

完成,密码已改为ABCabc@123

猜你喜欢

转载自blog.csdn.net/qq_30566629/article/details/110232804