ERROR 1045 (28000): Access denied for user 'root'@'SR3' (using password: YES)

来源:互联网 发布:js手风琴效果原理 编辑:程序博客网 时间:2024/05/21 11:05

解决方案:

 

[mysql@SR3 ~]$ mysql -h 10.86.87.155 -uroot -pinfohow
ERROR 1045 (28000): Access denied for user 'root'@'SR3' (using password: YES)
[mysql@SR3 ~]$ mysql -hlocalhost -uroot -pinfohow
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.5.16-log Source distribution

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

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

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

mysql> update user set password=PASSWORD("infohow") where user="root";
ERROR 1046 (3D000): No database selected
mysql> use mysql;
Database changed
mysql> update user set password=PASSWORD("infohow") where user="root";
Query OK, 3 rows affected (0.03 sec)
Rows matched: 4  Changed: 3  Warnings: 0

mysql> commit;
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

mysql> exit
Bye
[mysql@SR3 ~]$ mysql -h 10.86.87.155 -uroot -pinfohow
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.5.16-log Source distribution

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

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

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

mysql> exit