In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "forgot the mysql password how to reset", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "forget the mysql password how to reset" it!
Solution: 1, open the configuration file "my.cnf", add "skip-grant-tables" statement under "[mysqld]", restart the MySQL service; 2, execute the "mysql-u root" command to log on to the database without a password; 3, use the update command to reset the login password.
The operating environment of this tutorial: windows7 system, mysql8 version, Dell G3 computer.
What if I forget my mysql password? No, you can reset the password and reset a new password.
The way to reset the password
1. Modify the configuration file my.cnf, add skip-grant-tables under the configuration file [mysqld], and restart the MySQL service to log in without password.
The-- skip-grant-tables option means to skip authority table authentication when starting the MySQL service. After startup, the root connected to the MySQL will not need a password (dangerous).
[mysqld] skip-grant-tables
two。 A root user with an empty password connects to MySQL and changes the root password
Password-free login to MySQL database:
[root@iZ235wguph3Z www] # mysql-u rootWelcome to the MySQL monitor. Commands end with; or\ g.Your MySQL connection id is 295Server version: 5.0.56-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.
Reset password:
Mysql > update user set password=password ('123456') where User='root';ERROR 1046 (3D000): No database selectedmysql > use mysql;Database changedmysql > update user set password=password ('123456') where User='root';Query OK, 3 rows affected (0.00 sec) Rows matched: 3 Changed: 3 Warnings: 0mysql > flush privileges;Query OK, 0 rows affected (0.00 sec) mysql > exit
3. Remove the skip-grant-tables option from my.cnf, and then restart the MySQL service.
Thank you for your reading, the above is the content of "forget the mysql password how to reset", after the study of this article, I believe you forget the mysql password how to reset this problem has a deeper understanding, the specific use of the situation also needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.