Reconfigure MySQL.
Remove service, mysqld-nt-remove, success. There are other commands on the Internet, and the operation fails. Re-Configure. The error 1045 is displayed. Run the MySQL Command, set password for 'root' @ 'localhost' = PASSWORD ('root ');
After the system is reinstalled, install Mysql again. In the last step, Apply security settings and encounter another 1045 problem.
Code 1045
Access denied for user 'root' @ 'localhost' (using password: YES)
Google, it turned out to be a database file problem under {$ MYSQL_HOME} \ data, and stored the previous root Login User information under data. My solution is to delete all files under {$ MYSQL_HOME} \ data, and then install them. OK...
Is it cruel to do this?
The solution is to reset the root user password. The procedure is as follows on Windows:
1. log on to the system as a system administrator;
2. If the MySQL server is running, stop it.
If the server runs as a Windows Service, go to Service Manager: Start Menu-> Control Panel-> Administrative Tools-> services
If the server is not running as a service, you may need to use the task manager to force it to stop.
3. Create a text file and place the following commands in a single line:
Set password for 'root' @ 'localhost' = PASSWORD ('mynewpassword ');
Save the file with any name. In this example, the file is C: \ mysql-init.txt.
4. Enter the doscommand prompt: Start Menu-> Run-> cmd
Assume that you have installed MySQL to C: \ mysql. If you install MySQL in another location, adjust the following commands.
Run the following command at the doscommand prompt:
C: \> C: \ mysql \ bin \ mysqld-nt -- init-file = C: \ mysql-init.txt
When the server is started, run the "-- init-file" option (function: Read SQL commands from the specified file at startup) to change the root user password. When the server is successfully started, delete the C: \ mysql-init.txt.
5. Stop the MySQL server and restart it in normal mode. If you run the server as a service, you should start it from the Windows service window. If the server is started manually, the command can be used as usual.
The new password should be used for connection.