[Cracking the password chapter 01] mysql database

Crack the mysql database password


1. Enter the main database configuration file

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

Add skip-grant-tables in the fifth line
Insert picture description here
2. Restart the database service

[root@localhost ~]#  systemctl  restart  mysqld

3. Enter the database

[root@localhost ~]#  mysql

-------------------5.7 version is suitable for the following commands----------------

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. Restart the database service

[root@localhost ~]#  systemctl  restart  mysqld

5. Enter the main database configuration file

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

Add a note before skip-grant-tables
Insert picture description here
6. Restart the database service

[root@localhost ~]#  systemctl  restart  mysqld

Finished, the password has been changed to ABCabc@123

Guess you like

Origin blog.csdn.net/qq_30566629/article/details/110232804