This article analyzes the MySQL login error tip: Error 1045 (28000) solution. Share to everyone for your reference, specific as follows:
First, the question:
MySQL database of company Linux system root user set password, but often use command ' mysql-u root-p ' login error, sometimes can log in. The logon error message is:
[Root@localhost ~]# mysql-u root-p
Enter Password:
ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:yes)
Second, the reason: there are empty users in the database caused by
Third, the solution:
1, stop the use of MySQL services:
2, enter the command:
# Mysqld_safe--user=mysql--skip-grant-tables--skip-networking &
3, log into the database:
4,
5,
Mysql> select User,host,password from user;
The results are as follows:
+------+-----------------------+----------+
| user | Host | password |
+------+-----------------------+----------+
| Root | % | Mima |
| Root | Localhost.localdomain | Mima |
| Root | 127.0.0.1 | Mima |
| | localhost | |
| | Localhost.localdomain | |
+------+-----------------------+----------+
6, the above query out of the empty user delete:
mysql> Delete from user where user= ';
7, exit the database:
8, start the MySQL service:
9. Re-use the order:
Login, ok!
For more information about MySQL interested readers can view the site topics: "MySQL Transaction operation skills Summary", "MySQL stored process skills encyclopedia", "MySQL database lock related skills summary" and "MySQL common function large summary"
I hope this article will help you with the MySQL database meter.