MySQL登陸時報ERROR 1045 (28000): Access denied for user 的解決方法

在進行mysql登陸時報下列錯誤mysql

[root@mdb1 ~]# mysql -u mmm_agent -h 10.10.1.33 -p
Enter password:
ERROR 1045 (28000): Access denied for user 'mmm_agent'@'mdb1.clvn.com.cn' (using password: YES)
用root用戶登陸mysql,查看usre表信息sql

mysql> select host,user,password from user;
+-------------------+-------------+-------------------------------------------+
| host                       | user        | password                                  |
+-------------------+-------------+-------------------------------------------+
| localhost                | root        | *84BB5DF4823DA319BBF86C99624479A198E6EEE9    |
| mdb1.clvn.com.cn   | root        | *84BB5DF4823DA319BBF86C99624479A198E6EEE9     |
| 127.0.0.1                 | root        |                                                                               |
| localhost                |               |                                                                                |
| mdb1.clvn.com.cn   |               |                                                                               |
| 10.10.1.34               | repl_user   | *84BB5DF4823DA319BBF86C99624479A198E6EEE9      |
| 10.10.1.35               | repl_user   | *84BB5DF4823DA319BBF86C99624479A198E6EEE9      |
| 10.10.1.36               | repl_user   | *84BB5DF4823DA319BBF86C99624479A198E6EEE9      |
| 10.10.1.%               | mmm_monitor | *84BB5DF4823DA319BBF86C99624479A198E6EEE9 |
| 10.10.1.%               | mmm_agent   | *84BB5DF4823DA319BBF86C99624479A198E6EEE9  |
| 10.10.1.%               | opensips    | *84BB5DF4823DA319BBF86C99624479A198E6EEE9     |
+-------------------+-------------+-------------------------------------------+
11 rows in set (0.00 sec)
執行下列命令ide

mysql> DELETE FROM user WHERE password='';ui

再次登陸ip

[root@mdb1 ~]# mysql -u mmm_agent -h 10.10.1.33 -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3011
Server version: 5.1.73-log Source distributionget

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.input

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.it

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.io

mysql>
class

問題解決!

相關文章
相關標籤/搜索