Today, I tried to install MySQL for more than five minutes and didn't eat it for lunch. First, the start service failed, and then the apply security settings failed (a 1045 error was reported ), later, TMD finally got it through. The solution is as follows:
Solution 1. Uninstall and reinstall the instance. The root password is not set because the default MySQL password is empty.
Solution 2. keep the current password, open "MySQL command line client", and enter your password (which is set during installation. If the password is incorrect, try to log on with a blank password, the password setting may be invalid during installation ).
After successful logon, enter the following command:
Set password for 'root' @ 'localhost' = PASSWORD ('mysql'); 'mysql' the new password you want to set. After successfully changing the password, you can configure MySQL again.
Appendix: how to close the beep of an error in MySQL. Open my In the MySQL installation directory. in the INI file, add the statement 'no-Beep 'under the [MySQL] Line, save the statement, and restart the MySQL service.