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!