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)
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
Find mysql in the computer "Services" and double-click to find the corresponding path
mysqld --console --skip-grant-tables --shared-memoryThe 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
mysql -u root -pClick
directly at the command input
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!