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 mysql resets passwords

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how mysql resets passwords. The editor thought it was very practical, so I shared it with you as a reference. Let's follow the editor and have a look.

Remember the password and prepare to change the new password

Connect to the mysql database and enter instructions in cmd:

Mysql-uroot-p

Then enter the password by pressing enter.

two。 Switch the database:

Use mysql

* mysql is the default database of the system, which contains a user table that stores the user name and password of the current database user. *

3. Modify the password of user table in mysql database

Update user set password=password ('root') where user='root'

* password ('root') is a function, and root is the modified new password, which is passed as an argument to the password () function *

4. Restart the service for mysql.

Forget your password and prepare to reset it

Stop the mysql service and execute the instructions in the cmd window:

Compmgmt.msc

Open Compute Management-> Services and applications-- > Services-> mysql, and stop the service.

two。 Open the cmd window and execute the command inside the window:

Mysqld-- skip-grant-tables / / (don't add semicolons after it)

This instruction is to skip the security check.

After this instruction is executed, we will see the cursor flashing, indicating that a service is turned on, similar to the tomcat server.

3. Keep the current cmd window open, open another cmd window, connect to the mysql database mysql-u root, switch the database use mysql; to modify the user table password in the mysql database; for more information, please refer to the operation of "remember password and prepare to change new password" above.

4. Close the two cmd windows, and Ctrl+Shift+Esc opens the task manager to find mysqld's process and kill it.

5. Start the mysql service:

Open Compute Management-> Services and applications-- > Services-> mysql, and start the service.

Thank you for reading! On how to reset the password mysql to share here, I hope that the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, you can share it and let more people see it.

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