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

The solution of mysql forgetting root password under windows

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

1. Stop the MYSQL service, CMD opens the DOS window, and enter net stop mysql

2. In the CMD command line window, go to the MYSQL installation directory such as E:\ Program Files\ MySQL\ MySQL Server 5.0\ bin

Demonstration commands:

Enter e: enter

Enter cd "E:\ Program Files\ MySQL\ MySQL Server 5.0\ bin"

Note that double quotation marks should also be entered so that you can enter the Mysql installation directory.

3. Enter mysql security mode, that is, when mysql is up, you can enter the database without entering a password.

The command is: mysqld-nt-- skip-grant-tables

4. Reopen a CMD command line window, type mysql-uroot-p, and log in to MySQL with an empty password (press enter instead of entering the password)

5. Enter the following command to change the password of the root user (Note: there is a "dot" in the mysql.user in the command)

Mysql > update mysql.user set password=PASSWORD ('new password') where User='root'

6, refresh the permission table

Mysql > flush privileges

7, quit

Mysql > quit

In this way, the MYSQL Super Admin account ROOT has been reset, then end the mysql-nt.exe process in the Task Manager and restart MYSQL! (you can also restart the server directly)

After MYSQL restarts, you can log in to MYSQL with the newly set ROOT password!

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