database apps that ignore sockets? [was: Solution: mysqld fails to run, can't create/find mysql.sock]

Paul Beard paulbeard at gmail.com
Sun Jan 15 17:50:46 UTC 2012


On Jan 15, 2012, at 9:20 AM, Chuck Swiger wrote:

> You're confusing two things which are different.


At the risk of boring everyone on this list, I think I understand it as far as I need to: I am not the developer of the app(s) that seem to generate this issue. 

> If you specify a path via "--socket=/tmp/mysqld.sock", you are describing a UNIX domain socket.  While you can also specify "--host=localhost", that would be ignored because it it implicit.  If you change where the socket lives in mysqld config or CLI options, you need to change where the clients look for the socket as well.
> 
> If you specify a hostname and port via "--host=localhost --port=3306", then you are describing a TCP socket.  There is no pathname involved.  You could connect regardless of where mysqld is putting the socket.

If I gave the impression I didn't understand this, my mistake. 

The app configurations are not this granular: hostname and port are configured but there is nothing that makes clear that IF you specify localhost, you WILL BE using a domain socket which MUST BE /tmp/mysql.sock and IF you move it or your distribution prefers some other location you MAY NOT use localhost as you are now using a TCP socket which shouldn't require a hostname but because of the way the app is written, it does. 

Put another way, if you specify localhost, the port is ignored: I just tested this by setting the port to 9999 with a symlink to the socket placed in /tmp. It worked fine. If you change the location of the socket, you MUST use a TCP socket which mean identifying the host by name, not as localhost, even if it is localhost. There is no way to specify the location of the domain socket. It must be in /tmp. 

Note I am not arguing that the use of localhost requires a named domain socket, in UNIX, just that it does in this app. 

I learned a couple of things here. I hope I can make them clear to the people who need 'em. 


--
Paul Beard

Are you trying to win an argument or solve a problem? 



More information about the freebsd-questions mailing list