The MySQL manual says
--socket=file_name, -S file_name ... On Unix, the name of the
Unix socket file to use, for connections made using a named pipe
to a local server.
The default Unix socket file name is /tmp/mysql.sock.
which might surprise folks who've had to contend with the error
message
"Can't connect to local MySQL server through socket
'[something-other-than-/tmp/mysql.sock]'".
I'll try to explain here why the name is often something quite different, how to know what the MySQL server is really listening for, what the fixes are for either users or application developers, and why it still matters.
Why the name is not always /tmp/mysql.sock
First, the Linux Foundation publishes a document "Filesystem Hierarchy Standard". Version 2.3 says …
[Read more]