当我尝试连接到mysql服务器时访问被拒绝

时间:2015-06-08 09:52:49

标签: mysql

我正在尝试使用Query Browser连接到MySQL服务器。但是,我在Windows命令提示符Host is not allowed to this MySQL server instance中收到以下错误消息我尝试了STACK OVERFLOW中建议的所有内容,如GRANT命令然后试图访问。它可能是一个重复的'题。但请回答我。

 Microsoft Windows [Version 6.1.7601]
  Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\Admin>mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 211
 Server version: 5.0.95-community-nt MySQL Community Edition (GPL)

 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> GRANT ALL ON *.* TO 'root'@'123.28.88.45' WITH GRANT OPTION;
   ERROR 1045 (28000): Access denied for user ''@'localhost' (using password: NO)
   mysql> GRANT ALL ON *.* TO 'root'@'123.28.88.45' WITH GRANT OPTION
-> FLUSH PRIVILEGES
-> mysql -u root -p
-> \q

1 个答案:

答案 0 :(得分:0)

尝试使用mysql -uroot -p而不是mysql登录。 你的上一个Grant-Command失败了,因为你错过了一个分号。

BR 克里斯

相关问题