Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Jan 2012 09:50:40 -0800
From:      Paul Beard <paulbeard@gmail.com>
Cc:        FreeBSD-questions <questions@Freebsd.org>
Subject:   Re: database apps that ignore sockets? [was: Solution: mysqld fails to run, can't create/find mysql.sock]
Message-ID:  <4F952937-843B-4E38-B168-4E1720555D89@gmail.com>
In-Reply-To: <0E0B740B-4E2C-41C8-A8A4-BC92DC0D7089@mac.com>
References:  <0F82362E-2694-4EBC-B019-DE2F2C160D45@gmail.com> <7325D262-C6EB-42DB-870D-D3E2FAC9D0C1@mac.com> <1954AA20-BE6F-4F04-A770-49ECFA405B5D@gmail.com> <3D14230E-7E8A-4E35-8161-F5F9CB74C83C@mac.com> <3720E228-67EE-4F44-B828-AFA0125D2A54@gmail.com> <0E0B740B-4E2C-41C8-A8A4-BC92DC0D7089@mac.com>

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

--Apple-Mail=_4721D9E5-5DB0-4160-B92E-92E5C7B69D39
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii


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


--Apple-Mail=_4721D9E5-5DB0-4160-B92E-92E5C7B69D39--



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?4F952937-843B-4E38-B168-4E1720555D89>