简体   繁体   English

与MAC的MySQL-DB连接!

[英]MySQL-DB Connection with MAC!

When i try to connect to my MYSQL-DB from a Windows-PC everything works, but when i try it from a Mac (I tried it with 2 macs) i get the errormessage "Can't get hostname". 当我尝试从Windows-PC连接到我的MYSQL-DB时,一切正常,但是当我从Mac上尝试它时(我尝试使用2个mac)我得到错误消息“无法获取主机名”。 I'm using MySQL-Workbench 5.2.31. 我正在使用MySQL-Workbench 5.2.31。 The DB is running on Windows Server 2008 R2. 数据库正在Windows Server 2008 R2上运行。

EDIT: More Info: 编辑:更多信息:

  • The MYSQL Server is running on a Windows Server 2008 R2 machine. MYSQL服务器在Windows Server 2008 R2计算机上运行。
  • The Server works, because i can connect from a Windows-PC. 服务器工作,因为我可以从Windows-PC连接。 (The Windows-PC is not the Server) (Windows-PC不是服务器)
  • The Port for the MYSQL Server (3306) is definitely open! MYSQL服务器端口(3306)绝对开放!
  • The Hostname is the DNS-address of the server! Hostname是服务器的DNS地址!

Thanks in advance! 提前致谢!

You need to add the ip-adress and a hostname in the hosts-file of the server. 您需要在服务器的hosts文件中添加ip-adress和主机名。 The server tries to get a hostname for the ip of the mac, but can't find any. 服务器尝试获取mac的ip的主机名,但找不到任何。 You may turn off this check in the config of your mySQL Server. 您可以在mySQL Server的配置中关闭此检查。

Check your dns settings. 检查你的DNS设置。 On mac, open a terminal check if nslookup win2008_dns_address resolves to your ip address. 在Mac上,打开终端检查nslookup win2008_dns_address是否解析为您的IP地址。 If not, fix your dns settings. 如果没有,请修复您的DNS设置。 Otherwise, again on mac, sudo vi /etc/hosts and append your Win2008 server ip and win2008 hostname there. 否则,再次在mac,sudo vi / etc / hosts上添加你的Win2008服务器ip和win2008主机名。 Correct format would be 格式正确

IP_ADDRESS    HOSTNAME

save and try. 保存并尝试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM