Documentation Home
MySQL Connector/J 8.0 Developer Guide
Related Documentation Download this Manual
PDF (US Ltr) - 467.4Kb
PDF (A4) - 471.3Kb
HTML Download (TGZ) - 113.4Kb
HTML Download (Zip) - 131.2Kb

MySQL Connector/J 8.0 Developer Guide  /  Connector/J Reference  /  Connecting Using Named Pipes

6.9 Connecting Using Named Pipes


Support for named pipes is not available for X Protocol connections.

Connector/J also supports access to MySQL using named pipes on Windows platforms with the NamedPipeSocketFactory as a plugin-sockets factory. If you do not use a namedPipePath property, the default of '\\.\pipe\MySQL' is used. If you use the NamedPipeSocketFactory, the host name and port number values in the JDBC URL are ignored. To enable this feature, set the socketFactory property:


Set this property, as well as the path of the named pipe, with the following connection URL:


To create your own socket factories, follow the sample code in com.mysql.cj.protocol.NamedPipeSocketFactory or com.mysql.cj.protocol.StandardSocketFactory.

An alternate approach is to use the following two properties in connection URLs for establishing named pipe connections on Windows platforms:

  • (protocol=pipe) for named pipes (default value for the property is tcp).

  • (path=path_to_pipe) for path of named pipes. Default value for the path is \\.\pipe\MySQL.

The address-equals or key-value form of host specification (see Single host for details) greatly simplifies the URL for a named pipe connection on Windows. For example, to use the default named pipe of \\.\pipe\MySQL, just specify:


To use the custom named pipe of \\.\pipe\MySQL80 :


With (protocol=pipe), the NamedPipeSocketFactory is automatically selected.

Named pipes only work when connecting to a MySQL server on the same physical machine where the JDBC driver is running. In simple performance tests, named pipe access is between 30%-50% faster than the standard TCP/IP access. However, this varies per system, and named pipes are slower than TCP/IP in many Windows configurations.

User Comments
User comments in this section are, as the name implies, provided by MySQL users. The MySQL documentation team is not responsible for, nor do they endorse, any of the information provided here.
Sign Up Login You must be logged in to post a comment.