WinXP Install Mysql Error 1045 Access denied solution _mysql

Source: Internet
Author: User
Tags administrator password

Operating system: WINDOWS-XP system

Database version: MySQL 5.x


Tips: Access denied for user ' root ' @ ' localhost ' using password yes/no

Originally all good, today boot up to prompt the above error, restart MySQL or not.


Note that my environment here is the WINDOWS-XP system, the LINUX system operation has not been validated, the situation is not clear.


1. Admin login system, stop MySQL service or end MySQL process.


2. Start Windows Command Line window (that is, the usual DOS window: run cmd), switch to your "mysql\bin" directory.
For example, mine is "D:\Program files\mysql\mysql Server 5.2\bin", and then execute the following bold command: (Note your "My.ini" position)

Microsoft Windows XP [version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\administrator> CD D:\Program files\mysql\mysql Server 5.2\bin

C:\Documents and Settings\administrator>d:

D:\Program Files\mysql\mysql Server 5.2\bin> mysqld--defaults-file= "D:\Program files\mysql\mysql Server 5.2\my.ini"--console--skip-grant-tables


100608 9:04:12 innodb:started; Log sequence number 0 46409
100608 9:04:12 [note] Mysqld:ready for connections.
Version: ' 5.2.0-falcon-alpha-community ' socket: ' port:3306 MySQL Community
Server (GPL)
100608 9:06:57 [Warning] Found Invalid password for user: ' Root@localhost '; Ign
Oring User

As long as the above information appears, it means that MySQL has been up.


3. Do not close this command line window, reopen a command line window, also cut to the "Mysql\bin" directory, and then execute the following bold command:

Microsoft Windows XP [version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\administrator> CD D:\Program files\mysql\mysql Server 5.2\bin

C:\Documents and Settings\administrator>d:

D:\Program Files\mysql\mysql Server 5.2\bin> mysql-u Root MySQL
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 1
Server version:5.2.0-falcon-alpha-community MySQL Community Server (GPL)

Type ' help, ' or ' \h ' for help. Type ' \c ' to clear the buffer.

Then, the password is reset!

Mysql> UPDATE user SET Password=password (' root ') where user= ' root ';
Query OK, 1 row Affected (0.00 sec)
Rows matched:1 changed:1 warnings:0

Mysql> FLUSH privileges;
Query OK, 0 rows Affected (0.00 sec)

Mysql> quit
Bye

4. To this step, you can close the first DOS window (turn off the service). Open the System Services Control window (Control Panel-management tools-services) and start the MySQL service.

5. In the remaining Second DOS window, connect MySQL with the new ROOT password.

D:\Program Files\mysql\mysql Server 5.2\bin> mysql-u root-p
Enter Password: * * *
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 1
Server version:5.2.0-falcon-alpha-community-nt MySQL Community Server (GPL)

Type ' help, ' or ' \h ' for help. Type ' \c ' to clear the buffer.

Mysql> quit
Bye


At this point, the System Restore ROOT User management rights complete, is the administrator password problem, strange, the official installation of the time does not give a solution, seems to have existed for a long time ...

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.