What should I do if I forget the root password of mysql? 1. shut down the mysql database that is running and shut down the slave process. Mysqld.exe
2. close the database and go to the mysql bin directory,
3. enter mysqld -- skip-grant-tables in this path and press Enter. this command means to start the database in safe mode.
4. if the above steps are successful, a small cursor will appear in the cmd window, and no prompt will pop up. This indicates that your database has been started,
5. in this case, open a cmd window again and enter the installation path of the mysql database.
6. enter mysql-uroot-p. This command means to log on to MySQL with a blank password. if it succeeds, a prompt such as mysql> is displayed,
Note: What I get after entering mysql-uroot-p is the prompt for entering the password. then I enter a password and it will be OK !!!!
7. at last, enter update mysql. user set password = PASSWORD ('New password') where User = 'root ';
In the new password, enter the password you want to modify, close all cmd windows, follow the first step to turn off your server, and then run your server again in the normal step, at this time, your root password is changed to the new password you just set.