1. MySQL cannot start
Remember to run this command in cmd as administrator
First enter the tasklist | findstr "mysql command to find out the occupied programs, then taskkill/f /t /im mysqld.exe to terminate these programs and then they can start normally.
2. Forgot mysql password and cannot log in
(1) Open the command prompt as administrator
Right click on Command Prompt and open as administrator
(2) Stop the mysql service
输入命令mysqld --console --skip-grant-tables --shared-memory
(3) Open another cmd, enter mysql, and then update the password
The command is: update user set password=password('new password') where user='root' and host='localhost';
(4) An error message appears when entering the command to change the password.
It is caused by different versions. After mysql5.6, the password change command was replaced by update user set password=PASSWORD('Password to be modified') where user='root';
Finally, just refresh the mysql permissions!