Contents
What socket does mysql use?
mysqld.sock
The MySQL server’s socket file is named mysqld. sock and on Ubuntu systems it’s usually stored in the /var/run/mysqld/ directory.
What is mysql UNIX socket?
On Unix, you can connect to the mysqld server by using two different ways: a Unix socket file (for example, /var/run/mysqld/mysqld. A connection that is created with a Unix socket file is faster than TCP/IP but can only be used when connecting to a server on the same computer.
How do socket files work?
Unix sockets are bidirectional. This means that every side can perform both read and write operations. While, FIFOs are unidirectional: it has a writer peer and a reader peer. Unix sockets create less overhead and communication is faster, than by localhost IP sockets.
What is a socket file?
A socket is a special file used for inter-process communication, which enables communication between two processes. In addition to sending data, processes can send file descriptors across a Unix domain socket connection using the sendmsg() and recvmsg() system calls.
Can a socket be bound to a file name?
Traditionally, UNIX domain sockets can be either unnamed, or bound to a file system pathname (marked as being of type socket). Linux also supports an abstract namespace which is independent of the file system. I.e. not every socket can be seen as a file (in the sense of “no file without a file name”).
Where are most sockets located in the filesystem?
Most sockets: any Internet socket, or a Unix socket which is not in the filesystem namespace (it can be in the abstract namespace or unnamed). Files such as unnamed pipes or sockets are created by a process and can only be accessed in that process or in subsequently-created child processes.
Which is socket family is used in Linux?
The AF_UNIX (also known as AF_LOCAL) socket family is used to communicate between processes on the same machine efficiently. Traditionally, UNIX domain sockets can be either unnamed, or bound to a file system pathname (marked as being of type socket). Linux also supports an abstract namespace which is independent of the file system.
How to select on sockets 3 and 4?
If your application checks sockets 3 and 4, the second half of nmsgsfds should be set to 5. To select on descriptor numbers between 2048 and 65534, either the _OPEN_MSGQ_EXT or _OPEN_SYS_HIGH_DESCRIPTORS feature test macro must be defined, and a bit set larger than the default size must be used.