I am trying to understand why mysql uses the default Unix socket (/tmp/mysql.sock) instead of regular TCP / IP sockets.
This doesn't sound like security, since you can only listen to 127.0.0.1, which should be equally safe (the socket file is writable in the world, so you don't get protection based on Unix accounts).
And, of course, all operating systems rely on high-performance TCP / IP so much that it cannot be significantly slower than Unix sockets. Linux does all kinds of zero-copy tricks even for network traffic, so it should certainly be fast for loopback.
So, is there a legitimate reason to use Unix sockets here, or is it just some weird historical case?
source
share