Solution: 1. Delete the mysql configuration file including the ProgramData hidden folder; 2. Run regedit and delete "HKEY_LOCAL_MACHINE", SOFTWARE and MYSQL in the registry; 3. Restart the computer and restart The installation will not report errors.
The operating environment of this tutorial: windows10 system, mysql8.0.22 version, Dell G3 computer.
The 1045 error code appears. Usually, the previously installed mysql has not been deleted, and all residual files of the system need to be deleted.
If the mysql installation package is retained, run it directly and remove the local mysql.
1. Delete the C:\Program Files\mysql folder;
Delete the C:\ProgramData\mysql folder ( ProgramData is a hidden folder and needs to be opened)
2. Win r, run regedit, delete HKEY_LOCAL_MACHINE, SOFTWARE, MYSQL## in the registry
# HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\MySQL Directory deletion HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\Eventlog\Application\MySQL Directory deletion HKEY_LOCAL_MACHINE\SYSTEM\ Delete the CurrentControlSet\Services\Eventlog\Application\MySQL directory3. Restart the computer and reinstall mysql.
When the installation proceeds to set the password, please note that since this is the second installation, there will be an additional Current root password. Because the previous installation was not successful the first time, the password setting is invalid. Therefore, the Current root password is empty, do not fill it in here, just enter the new password in the New root password box, and then install it step by step. After installation, you can open cmd, enter the bin directory of the mysql installation directory, enter mysql -uroot -p password to log in, if the login is successful, the installation is successful. Recommended learning:The above is the detailed content of How to solve mysql installation failure 1045 error. For more information, please follow other related articles on the PHP Chinese website!