In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how the ECS Windows server MySQL resets the root password. I hope you will learn a lot after reading this article. Let's discuss it together.
1. Stop the MySQL service:
First, check whether the MySQL service is started, and if so, stop the MySQL service first. There are two ways to stop it:
1) Click the [start] menu-- [run]-- execute the "cmd" command to open a command prompt window and execute
Net stop MySQL5.1
Note: "MySQL5.1" here refers to the full name of the MySQL service, subject to the actual situation. The query command is as follows:
Sc query state=all | findstr / I mysql
After the command is executed, the full name of the MySQL service is displayed.
You can also view the full name of the MySQL service in "Management tools"-"Services".
2) in * * Management tools * *-> * * Services * *, locate the MySQL service, double-click the MySQL service name, and click * * stop * *.
two。 Skip permission security check:
Execute the command:
C:\ websoft\ mysql\ bin\ mysqld-- defaults-file= "C:\ websoft\ mysql\ my.ini"-- console-- skip-grant-tables
After this command is executed, the MySQL service is run, and when you connect to MySQL later, you don't have to enter a password for the time being.
Note: C:\ websoft\ mysql\ bin\ mysqld-- is the directory path of the MySQL service process
-- defaults-file= "C:\ websoft\ mysql\ my.ini"-- it is the directory path of the MySQL configuration file. Please refer to the local environment.
3. Log in to MySQL:
Open a new command prompt window and log in to MySQL with the following command:
C:\ websoft\ mysql\ bin\ mysql-uroot-p
In the Enter password: interface, enter directly (no password is required), and the login success message appears.
4. Reset password:
Execute the following commands in turn:
Use mysql;UPDATE user SET Password=PASSWORD ('newpassword') where USER='root';FLUSH PRIVILEGES;quit
Note: the "newpassword" is the new password. Please define your own password.
5. Verify the password:
The MySQL password has been reset through the above steps, and you can log in again to verify it. The command is as follows:
C:\ websoft\ mysql\ bin\ mysql-uroot-pEnter password: * enter a new password in this interface to log in.
Note: after the password modification is completed, if the user's website program uses the above modified account to connect to the database, please adjust the password used to connect to the database in time to prevent the user's program business from being unable to connect to the database.
After reading this article, I believe you have a certain understanding of ECS Windows server MySQL how to reset root password, want to know more about it, welcome to follow the industry information channel, thank you for reading!
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.