In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces the MySQL database lost root password solution, has a certain reference value, interested friends can refer to the next, I hope you read this article after a lot of gains, the following let Xiaobian with everyone to understand.
After the MySQL database loses its root password, we need to terminate the mysql service process. Below the windows. How do I lose my root password in MySQL database? What are MySQL password recovery methods?
MySQL database lost root password how to do
One is that you can end it through Task Manager, which should be mysql-nt.exe. Second, if your mysql is registered as a service, you can stop it first in the service.
Under linux or unix directly kill mysql service process can be. Then start the mysql service with the--skip-grant-tables option. Under windows, run mysql-nt--skip-grant-tables under the bin directory of mysql installation directory to start mysql service, so that you can enter mysql without password and use mysql-uroot-p
Under linux, the mysql directory is generally in: /usr/bin/safe_mysqld--skip-grant-tables, and the execution can be started. Under Freebsd, perform boot in/usr/local/etc/rc.d/mysql-server--skip-grant-tables.
After entering mysql, execute the following statement:
usemysqlupdateusersetpasswordpassword=password("new_pass")whereuser="root"flushprivileges;
Finally, let's end the current mysql service process, restart your mysql, and you can log in with the password you set.
What are MySQL password recovery methods?
Method 1:
If you forget MySQL's root password, you can reset it as follows:
1. KILL MySQL process in the system: killall-TERMmysqld
2. Start MySQL without checking permissions with the following command: safe_mysqld--skip-grant-tables&
3. Then log in to MySQL as root with an empty password: mysql-uroot
4. Change the password of root user;
mysql>updatemysql.usersetpassword=PASSWORD ('new password') whereUser='root'; mysql>flushprivileges;mysql>quit
Restart MySQL and log in with the new password.
Method 2:
1. Stop MYSQL service, CMD open DOS window, enter netstopmysql
2. In CMD command line window, enter MYSQL installation directory such as d:\mysql20080505\bin
3. Enter mysql security mode, that is, when mysql gets up, you can enter the database without entering a password. The command is: mysqld-nt--skip-grant-tables
4. Re-open a CMD command line window, enter mysql-uroot-p, and log in MySQL with an empty password (press Enter without entering a password).
5. Enter the following command to start changing the root password (note: mysql.user command has a "dot")
mysql>updatemysql.usersetpassword=PASSWORD ('new password') whereUser='root';
6. Refresh permissions table: mysql>flushprivileges;
7. exit
mysql>quit This MYSQL super administrator account ROOT has been reset, then in the task manager to end the mysql-nt.exe process, restart MYSQL can! (You can also restart the server directly)MYSQL restart, you can use the newly set ROOT password landing MYSQL!
Thank you for reading this article carefully. I hope that the article "MySQL Database Lost Root Password Solution" shared by Xiaobian will be helpful to everyone. At the same time, I hope that everyone will support it more, pay attention to the industry information channel, and more relevant knowledge is waiting for you to learn!
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.