MySQL 1045 error service cannot find path Solution

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.