0

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". I'm using MySQL-Workbench 5.2.31. The DB is running on Windows Server 2008 R2.

EDIT: More Info:

  • The MYSQL Server is running on a Windows Server 2008 R2 machine.
  • The Server works, because i can connect from a Windows-PC. (The Windows-PC is not the Server)
  • The Port for the MYSQL Server (3306) is definitely open!
  • The Hostname is the DNS-address of the server!

Thanks in advance!

2
  • 1
    Please add more info. Where is the server running, what host name are you using... Commented Feb 28, 2011 at 11:08
  • 1
    add more info.. How are you trying to connect? What commands are you using? Commented Feb 28, 2011 at 11:12

2 Answers 2

1

You need to add the ip-adress and a hostname in the hosts-file of the server. The server tries to get a hostname for the ip of the mac, but can't find any. You may turn off this check in the config of your mySQL Server.

Sign up to request clarification or add additional context in comments.

Comments

1

Check your dns settings. On mac, open a terminal check if nslookup win2008_dns_address resolves to your ip address. If not, fix your dns settings. Otherwise, again on mac, sudo vi /etc/hosts and append your Win2008 server ip and win2008 hostname there. Correct format would be

IP_ADDRESS    HOSTNAME

save and try.

6 Comments

I tried it, but now i get the error message "Lost connection to MySQL server at ‘reading initial communication packet’, system error: 61" :(
There is a line in my.cnf : bind-address IP_ADDRESS what is the value in your config? If it reads 127.0.0.1, then comment the line out and restart mysql. Also please note that you need to add appropriate firewall rules to permit mysql traffic.
restart the mysql server? EDIT: in the my.cnf (in the xampp folder [xampp is also installed on the mac], in the /etc/ folder was't a my.cnf) was no bind-address line.
if you change config, yes you should restart the mysql server instance to apply changes.
Can you access mysql on 2008? Try with telnet 2008_ip 3306
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.