Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Jan 2012 09:50:40 -0800
From:      Paul Beard <>
Cc:        FreeBSD-questions <>
Subject:   Re: database apps that ignore sockets? [was: Solution: mysqld fails to run, can't create/find mysql.sock]
Message-ID:  <>
In-Reply-To: <>
References:  <> <> <> <> <> <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help

Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;

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.=20

> If you specify a path via "--socket=3D/tmp/mysqld.sock", you are =
describing a UNIX domain socket.  While you can also specify =
"--host=3Dlocalhost", 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=3Dlocalhost =
--port=3D3306", 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.=20

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.=20

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.=20

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

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

Paul Beard

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


Want to link to this message? Use this URL: <>