Home > Database > Mysql Tutorial > body text

What is the method to reset mysql forgotten password?

WBOY
Release: 2023-06-02 20:43:13
forward
1971 people have browsed it

When we use the mysql database, if we forget the password, the following picture will be displayed

ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password : YES)

What is the method to reset mysql forgotten password?

Generally speaking, we have two solutions. One is to uninstall and reinstall, and to skip the password verification and change the password is obviously the same. A more convenient option. The steps of this method are as follows:

1. Close the mysql server

What is the method to reset mysql forgotten password?

##1. Find the bin directory path in the mysql installation path

Find mysql in the computer "Services" and double-click to find the corresponding path

What is the method to reset mysql forgotten password?

2. Open the command line with administrator rights and jump to the bin directory path under the installation path. At

What is the method to reset mysql forgotten password?

#3. Enter the command on the command line to skip the password verification of mysql

mysqld --console --skip-grant-tables --shared-memory

The mysqld command is in the bin directory. This command can only be executed if the command line jumps to the bin directory. Do not close this window after entering the command

What is the method to reset mysql forgotten password?

4. Open another dos command window with administrator rights and enter the login command

mysql -u root -p

Click

directly at the command input

What is the method to reset mysql forgotten password?

5. Use the sql command to jump to mysql table and change the password

What is the method to reset mysql forgotten password?

6. Enter the flush privileges command and exit

What is the method to reset mysql forgotten password?

7. Close all command lines window, and re-open a dos window as an administrator. 8. Restart the mysql server

What is the method to reset mysql forgotten password?

9. You can use the set password to access the mysql server

What is the method to reset mysql forgotten password?

The above is the detailed content of What is the method to reset mysql forgotten password?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template