2017-09-07 65 views
0

在我的办公室里,有一台桌面电脑是CentOS7.2系统,里面安装了MySQL。MySQL说:主机'10.10.10.121'不允许连接到这个MySQL服务器

在我的电脑中,我有一个Sequel Pro。

我想使用Sequel Pro连接桌面电脑的mysql。

但得到这个错误:

Unable to connect to host 10.10.10.127, or the request timed out. 

Be sure that the address is correct and that you have the necessary privileges, or try increasing the connection timeout (currently 10 seconds). 

MySQL said: Host '10.10.10.121' is not allowed to connect to this MySQL server 

台式计算机的ip是10.10.10.127,我的是10.10.10.121

+0

[如何允许远程连接到mysql]可能的重复(https://stackoverflow.com/questions/14779104/how-to-allow-remote-connection-to-mysql) – m0skit0

回答

1

至于你的情况,你应该设置远程登录用户权限在你的mysql:

  1. 在您的桌面计算机,登录到mysql:

    mysql -u root -p 
    
  2. 授予特权时

    GRANT ALL PRIVILEGES on yourDB.* to 'root'@'10.10.10.121' IDENTIFIED BY 'the password'; 
    
  3. flush privileges

然后,您可以使用该工具在您的计算机中连接桌面计算机的mysql。

你最好修复台式电脑和你电脑的局域网IP。

0

您正在使用的mysql用户没有对服务器的访问权限。提供类似

GRANT ALL ON foo.* TO [email protected]'162.54.10.20' IDENTIFIED BY 'PASSWORD'; 

其中foo是数据库名称,bar是用户。 你也可以考虑创建新的mysql用户从你的机器访问。 我希望这有助于。欲了解更多信息,请查阅http://www.debianhelp.co.uk/remotemysql.htm

相关问题