2017-09-07 102 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

相關問題