In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article will explain in detail the solution to forget your password in mysql. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
Mysql's solution to forgetting your password: first find the "my.ini" file; then add "skip-grant-tables" under "mysqld"; then restart the mysql service; and finally reset the password through update.
The operating environment of this article: Windows7 system, Dell G3 computer, MySQL Server 5.7.
What if mysql forgets his password?
When we install and use MySQl, we may not be able to avoid forgetting your password. If you forget your password, you can follow the following procedure:
Find the my.ini file
My.ini file sets the file for MySQl, if you are the default installation address, the file is in the
C:\ ProgramData\ MySQL\ MySQL Server 5.7
But ProgramData is normally hidden.
Set permission authentication to skip
That is, add skip-grant-tables under [mysqld]
Skip-grant-tables
Restart the mysql service
Here you can enter continuously on the command line or find the mysql service restart in the service.
Net stop mysql net start mysql
After reboot, log in as mysql-uroot-p
We will find that we can log in without a password.
Mysql-uroot-p
Reset password
First select the mysql database
Use mysql
Then update password
Update user set authentication_string = password ('new-password') where user =' root'
Note: what you want to change here is the authentication_string, not the password field.
Input
Update user set Password=password ('new-password') where user='root'
Will report an error: ERROR 1054 (42S22): Unknown column 'password' in' field list'
The reason is that there is no password field under the mysql database, and the password field has been changed to authentication_string
Remove the added skip-grant-tables from the my.ini file
Restart the mysql service
Log in with a new password
This is the end of this article on "the solution to mysql forgetting your password". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
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.