Documentation Home
MySQL Connector/J 5.1 Developer Guide
Related Documentation Download this Manual
PDF (US Ltr) - 0.6Mb
PDF (A4) - 0.6Mb

5.3.1 Connection/Authentication

  • user

    The user to connect as

    Since Version all versions
  • password

    The password to use when connecting

    Since Version all versions
  • socketFactory

    The name of the class that the driver should use for creating socket connections to the server. This class must implement the interface 'com.mysql.jdbc.SocketFactory' and have public no-args constructor.

    Default Value com.mysql.jdbc.StandardSocketFactory
    Since Version 3.0.3
  • connectTimeout

    Timeout for socket connect (in milliseconds), with 0 being no timeout. Only works on JDK-1.4 or newer. Defaults to '0'.

    Default Value 0
    Since Version 3.0.1
  • socketTimeout

    Timeout (in milliseconds) on network socket operations (0, the default means no timeout).

    Default Value 0
    Since Version 3.0.1
  • connectionLifecycleInterceptors

    A comma-delimited list of classes that implement "com.mysql.jdbc.ConnectionLifecycleInterceptor" that should notified of connection lifecycle events (creation, destruction, commit, rollback, setCatalog and setAutoCommit) and potentially alter the execution of these commands. ConnectionLifecycleInterceptors are "stackable", more than one interceptor may be specified via the configuration property as a comma-delimited list, with the interceptors executed in order from left to right.

    Since Version 5.1.4
  • useConfigs

    Load the comma-delimited list of configuration properties before parsing the URL or applying user-specified properties. These configurations are explained in the 'Configurations' of the documentation.

    Since Version 3.1.5
  • authenticationPlugins

    Comma-delimited list of classes that implement com.mysql.jdbc.AuthenticationPlugin and which will be used for authentication unless disabled by "disabledAuthenticationPlugins" property.

    Since Version 5.1.19
  • defaultAuthenticationPlugin

    Name of a class implementing com.mysql.jdbc.AuthenticationPlugin which will be used as the default authentication plugin (see below). It is an error to use a class which is not listed in "authenticationPlugins" nor it is one of the built-in plugins. It is an error to set as default a plugin which was disabled with "disabledAuthenticationPlugins" property. It is an error to set this value to null or the empty string (i.e. there must be at least a valid default authentication plugin specified for the connection, meeting all constraints listed above).

    Default Value com.mysql.jdbc.authentication.MysqlNativePasswordPlugin
    Since Version 5.1.19
  • disabledAuthenticationPlugins

    Comma-delimited list of classes implementing com.mysql.jdbc.AuthenticationPlugin or mechanisms, i.e. "mysql_native_password". The authentication plugins or mechanisms listed will not be used for authentication which will fail if it requires one of them. It is an error to disable the default authentication plugin (either the one named by "defaultAuthenticationPlugin" property or the hard-coded one if "defaultAuthenticationPlugin" property is not set).

    Since Version 5.1.19
  • disconnectOnExpiredPasswords

    If "disconnectOnExpiredPasswords" is set to "false" and password is expired then server enters "sandbox" mode and sends ERR(08001, ER_MUST_CHANGE_PASSWORD) for all commands that are not needed to set a new password until a new password is set.

    Default Value true
    Since Version 5.1.23
  • interactiveClient

    Set the CLIENT_INTERACTIVE flag, which tells MySQL to timeout connections based on INTERACTIVE_TIMEOUT instead of WAIT_TIMEOUT

    Default Value false
    Since Version 3.1.0
  • localSocketAddress

    Hostname or IP address given to explicitly configure the interface that the driver will bind the client side of the TCP/IP connection to when connecting.

    Since Version 5.0.5
  • propertiesTransform

    An implementation of com.mysql.jdbc.ConnectionPropertiesTransform that the driver will use to modify URL properties passed to the driver before attempting a connection

    Since Version 3.1.4
  • useCompression

    Use zlib compression when communicating with the server (true/false)? Defaults to 'false'.

    Default Value false
    Since Version 3.0.17