Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Resolve the mysql ERROR 1045 (28000)-Access denied for user problem

2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Problem description (the following discussion is limited to the Windows environment):

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 under the entry [mysqld]

Skip-grant-tables

As shown below:

After saving and exiting

Step 2: restart mysql

The restart steps are as follows:

1. Go to the task manager to see if mysqld.exe is running. If it is running, kill will drop.

two。 Find the bin folder under the mysql installation directory, then find the mysqld.exe file, double-click to run, and then go to the task manager again to see if mysqld.exe is running. After confirming that it is running, double-click the mysql.exe file.

Step 3: reset the password of the local mysql library

In cmd, go to the D:\ develop\ ide\ mysql\ mysql5.5\ bin directory and type mysql-u root-p to log in without a password. Enter directly when password: appears, and there will be no ERROR 1045 (28000), but many operations will be restricted because there is no permission. So you need to follow the following process (the red part is the input part, and the orange one is the code displayed after execution):

1. Access the mysql database:

Mysql > use mysql; Database changed

two。 Set a new password for root users. You need to enter it yourself in red and bold:

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 correcting it, modify the my.ini file again, delete the "skip-grant-tables" line we just added, save and exit, and then restart mysql.

Summary

The above is introduced by the editor to solve the mysql ERROR 1045 (28000)-Access denied for user problem. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply you in time. Thank you very much for your support to the website!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report