Mysql four communication protocols

1. Communication protocol

1. TCP/IP protocol

    > Usually we connect MySQL through this protocol, and various major programming languages ​​implement connection modules according to this protocol

2. Unix Socket Protocol

    > Usually we use this protocol to log in to the MySQL server, because to use this protocol to connect to MySQL requires a physical file, and the storage location of the file is defined in the configuration file. It is worth mentioning that this is the most efficient of all protocols. .

3. Share Memory Protocol

    > This protocol is not known to most people, and it must not be used, because this protocol can only be used by windows. To use this protocol, you need to use the --shared-memory parameter in the configuration file at startup. Note that, using this protocol, a host There can only be one server on the server, so this thing is generally useless unless you suspect that other protocols are not working properly. In fact, Microsoft's SQL Server also supports this protocol.

4. Named Pipes Protocol

    > This protocol can only be used by windows. Like shared memory, using this protocol, there can still only be one server on a host, even if different ports are used. Named Pipes is a protocol developed for local area networks. A portion of memory is used by one process to pass information to another, so the output of one process is the input of another. The second process can be local (on the same computer as the first process) or remote (on a networked computer). Because of this, if you don't have or disable TCP/IP environment in your environment, and it's a windows server, then at least your database will still work. Using this protocol requires adding the --enable-named-pipe option at startup

Reference: http://blog.csdn.net/joson793847469/article/details/52206692

 

2. MySQL TCP communication protocol communication format can refer to: vernacular MySQL TCP communication protocol - 5 minutes to understand

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325115625&siteId=291194637