Cannot connect to remote mysql from Mac lion

ⅰ亾dé卋堺 提交于 2019-12-08 03:56:51

问题


I'm a mac novice and trying to get a developer setup to develop php sites locally. The sites he develops have a mysql backend and that is on a remote box. We got xampp installed and working, he can connect from the website to the local mysql box but he cannot connect to the remote box. He is using the exact same connection info I am using from my windows system. I do not have any issues. Also the mysql server is setup to accept all users (we are currently using root) regardless of hostname.

I searched his system and I could not find a mysql.sock file. I do not know what this does, but googled some articles that mentioned.

Please help if you can.


回答1:


Try Telnetting to the server from your host and see if you get a response.

telnet host 3306

If that doesn't work, you probably have some local firewall on your mac that is blocking the connection. Also, one thing you don't mention is that you can connect from a windows computer and not a mac... are they on the same network? If they're on different networks or in different places, that could indicate a local network issue.

This is definitely not an issue with mysql, but with something on the Mac itself.




回答2:


The mysql.sock file is relevant only to the machine the MySQL server is running on, for local clients to communicate with the server. For any remote machines, they'll be connecting via TCP on port 3306.

Make sure that port 3306 is open in the server machine's firewall, and that MySQL has been configured to allow TCP connections.



来源:https://stackoverflow.com/questions/8001844/cannot-connect-to-remote-mysql-from-mac-lion

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!