Documentation Home
MySQL Connector/J 5.1 Developer Guide
Related Documentation Download this Manual
PDF (US Ltr) - 501.4Kb
PDF (A4) - 500.9Kb
HTML Download (TGZ) - 120.7Kb
HTML Download (Zip) - 139.0Kb


MySQL Connector/J 5.1 Developer Guide  /  Connector/J (JDBC) Reference  /  Connecting Using Unix Domain Sockets

5.8 Connecting Using Unix Domain Sockets

Connector/J does not natively support connections to MySQL Servers with Unix domain sockets. However, there is provision for using 3rd-party libraries that supply the function via a pluggable socket factory. Such a custom factory should implement the legacy com.mysql.jdbc.SocketFactory interface of Connector/J. Follow these requirements when you use such a custom socket factory for Unix sockets :

  • The MySQL Server must be configured with the system variable --socket, which must contain the file path of the Unix socket file.

  • The fully-qualified class name of the custom factory should be passed to Connector/J via the connection property socketFactory. For example, with the junixsocket library, set:

    socketFactory=org.newsclub.net.mysql.AFUNIXDatabaseSocketFactory

    You might also need to pass other parameters to the custom factory as connection properties. For example, for the junixsocket library, provide the file path of the socket file with the property junixsocket.file:

    junixsocket.file=path_to_socket_file


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.