Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to crack the root login password of MySQL5.7 database

2025-03-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

In this issue, the editor will bring you the root login password on how to crack the MySQL5.7 database. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

Introduction to this document describes in detail the root login password for cracking the MySQL5.7 database

Forget the root login password

[root@MySQL1] # mysql-uroot-p1231234mysql: [Warning] Using a password on the command line interface can be insecure.ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

Add skip-grant-tables to the / etc/my.cnf configuration file to bypass MySQL5.7 database password verification

[root@MySQL1 ~] # echo skip-grant-tables > > / etc/my.cnf [root@MySQL1 ~] # / etc/init.d/mysqld restartShutting down MySQL.. SUCCESS! Starting MySQL. SUCCESS!

Directly use the mysql command to log in to the MySQL5.7 database and change the root login password

[root@MySQL1] # mysqlWelcome to the MySQL monitor. Commands end with; or\ g.Your MySQL connection id is 3Server version: 5.7.19-log Source distributionCopyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or'\ h' for help. Type'c'to clear the current input statement.mysql > ALTER USER 'root'@'localhost' IDENTIFIED BY' password';ERROR 1290 (HY000): The MySQL server is running with the-- skip-grant-tables option so it cannot execute this statementmysql > flush privileges;Query OK, 0 rows affected (0.00 sec) mysql > ALTER USER 'root'@'localhost' IDENTIFIED BY' password';Query OK, 0 rows affected (0.00 sec) mysql > quitBye

Note: if an ERROR 1290 (HY000): The MySQL server is running with the-- skip-grant-tables option so it cannot execute this statement error occurs while performing this step. Then execute the flush privileges; command, and then execute the command.

Log in to the MySQL5.7 database with the new password password

[root@MySQL1] # mysql-uroot-ppasswordmysql: [Warning] Using a password on the command line interface can be insecure.Welcome to the MySQL monitor. Commands end with; or\ g.Your MySQL connection id is 4Server version: 5.7.19-log Source distributionCopyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.mysql > exitBye

You cannot log in to the MySQL5.7 database with a different password

[root@MySQL1] # mysql-uroot-ppassworddmysql: [Warning] Using a password on the command line interface can be insecure.ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

Optimize

Delete the skip-grant-tables in / etc/my.cnf

[root@MySQL1] # sed-I-e'/ skip-grant-tables/d' / etc/my.cnf

Restart the database

[root@MySQL1] # / etc/init.d/mysqld restart the above is shared by Xiaobian on how to crack the root login password of MySQL5.7 database. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report