Home >Database >Mysql Tutorial >What should I do if I forget mysql password?

What should I do if I forget mysql password?

王林
王林Original
2021-05-06 15:18:3044349browse

The solution to the forgotten mysql password: first open cmd and close the mysql service; then enter the mysql environment and find the user table; finally execute the update statement to modify the database password.

What should I do if I forget mysql password?

#The operating environment of this article: windows10 system, mysql 5.7, thinkpad t480 computer.

First open the cmd command line, execute the net stop mysql command, and turn off the mysql service first

What should I do if I forget mysql password?

Then execute the mysqld --skip-grant-tables command

What should I do if I forget mysql password?

Then enter mysql directly to enter the editing environment

What should I do if I forget mysql password?

##Then enter the show databases command and select the mysql database

What should I do if I forget mysql password?

Then enter the show tables command to find the user table

What should I do if I forget mysql password?

Finally execute the update statement to change the root password.

What should I do if I forget mysql password?

Free video tutorial:

mysql video tutorial

The above is the detailed content of What should I do if I forget mysql password?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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