MySQL implements four communication protocols

MySQL implements four communication protocols

  1. TCP/IP protocol, usually we connect MySQL through this protocol. Various major programming languages ​​implement connection modules according to this protocol.
  2. Unix Socket protocol, this protocol is usually used when we 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 common protocol among all protocols. Efficient one.
  3. Share Memory protocol, which most people don't know, and certainly haven't used it, 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, There can only be one server on a host, 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

Guess you like

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