What is the difference between socket and port connection in MySQL?

when I use "localhost" as the host for the MySQL database, the pro sequel warns me that I will use the socket. On the other hand, if I use "127.0.0.1", I would use the ip address and port 3306 to access the server.

What is the difference?

+4
source share
1 answer

A Unix connector is a data transfer endpoint that is similar to a network connector but does not use a network protocol for communication. They are used in POSIX operating systems for interprocess communication. ( Source )

The localhost -> socket rule seems to be hard-coded in the MySQL client library, according to a forum post by the MySQL developer. ( Source )

+3
source

Source: https://habr.com/ru/post/1304443/


All Articles