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

[data relocation] change the root password of mysql under windows

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

Share

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

When using MySQL for the first time, there are a lot of things that are not very clear and are still being explored. Because of a software, you have to change the password of root in MySQL. I originally wanted to reinstall MySQL, but you can't reinstall it every time you encounter it. Found some information, how to change the password, many people said on the Internet, after many experiments, the password changed. Some relevant orders are recorded below for future reference. You can use this method to change the password of mysql Super Admin root as long as your server operating system is Windows XP/2000/2003/NT.

1. Stop the MySQL service

Start-- run-- enter cmd, and in the command prompt window, type net stop mysql

2. Enter the bin directory in the MySQL installation directory in the command window

3. Enter MySQL security mode

Type mysqld-nt-- skip-grant-tables, and there is no reaction on the screen. Don't worry about it, just put it aside and continue.

4. Re-open a CMD command window, enter mysql-uroot-p in the newly opened command window, and then prompt for the password. Instead of entering the password, press enter directly to enter.

5, enter the following command to change the super administrator root password, note: there is a "point" in the command mysql.user; the command newpassword is the new password, according to your actual situation, change to the new password you want to set.

Update mysql.user set password = PASSWORD ('newpassword') where User =' root'

6. Refresh the permission table and enter the following command

Flush privileges

7. Quit

Quit

8. Restart the MySQL service

First open the task manager and say that the process of MySQL-nt.exr is over.

Then type net start mysql at the command prompt to restart the MySQL service.

In this way, we have changed the password of root in mysql.

As it is not commonly used now (bad memory), in case of timely need. The account of the blog has been stolen (the account of CSDN cannot be logged in), so transfer it here for now.

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