Solve the Problem of mysql ERROR 1045 (28000) -- Access denied for user, 28000 denied

Source: Internet
Author: User

Solve the Problem of mysql ERROR 1045 (28000) -- Access denied for user, 28000 denied

Problem description (the following scope is limited to Windows ):

 D:\develop\ide\mysql\mysql5.5\bin> mysql -u root -p Enter password: ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)

Step 1: edit the configuration file my. ini in the mysql installation directory and add it to the [mysqld] entry.

skip-grant-tables

For example:

Save and exit

Step 2: restart mysql

The restart procedure is as follows:

1. Enter the task manager to check whether mysqld.exe is running. If it is running, kill it;

The hosts file.

Step 3: reset the password of the local mysql database

In cmd, go to the D: \ develop \ ide \ mysql \ mysql5.5 \ bin directory and enter mysql-u root-p to log on without a password. The password is displayed: you can directly press enter to enter without ERROR 1045 (28000), but many operations are restricted because you do not have the permission. Therefore, follow the steps below (the red part is the input part, and the orange part is the code displayed after execution ):

1. Enter the mysql database:

 mysql> use mysql; Database changed

2. Set a new password for the root user. You must enter the new password in the bold red text box:

Mysql> update user set password = password ("new password") where user = "root"; Query OK, 1 rows affected (0.01 sec) Rows matched: 1 Changed: 1 Warnings: 0

3. Refresh the database

mysql> flush privileges;Query OK, 0 rows affected (0.00 sec)

4. Exit mysql:

mysql> quitBye

Step 4: Restore the my. ini file

After modification, modify the my. ini file and add the file"skip-grant-tables"Delete this line, save and quit, and then restart mysql.

Summary

The above section describes how to solve the problem of mysql ERROR 1045 (28000) -- Access denied for user. I hope to help you. If you have any questions, please leave a message, the editor will reply to you in a timely manner. Thank you very much for your support for the help House website!

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.