Mysql ERROR 1045 (28000) -- Access denied for user solution, 28000 denied

Source: Internet
Author: User

Mysql ERROR 1045 (28000) -- Access denied for user solution, 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 in the mysql installation directoryMy. ini, In[Mysqld]Add under this 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 enterMysql-u root-pYou can log on without a password.Password:You can directly press enter to enter without ERROR 1045 (28000), but many operations are restricted because you do not have the permission. So you need to follow the process below (The red part is the input part., Orange 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> quit
Bye

 

Step 4:Restore the my. ini file
After modification, modify it again.My. iniThis file adds"Skip-grant-tables"Delete this line,Save and exit and restart mysqlYou can.

 

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.