Docs Menu

JDBC Authentication Plugin

On this page

  • Prerequisites
  • Installing the Plugin

New in version 2.2.

The MongoDB Connector for BI provides a client-side MySQL authentication plugin for Java that integrates with MySQL's Connector/J JDBC driver. The mongosql_auth plugin allows a client to authenticate with a BI Connector and MongoDB deployment running with authentication enabled using one of the following authentication mechanisms:

  • SCRAM-SHA-256
  • GSSAPI (Kerberos)
  • The SCRAM-SHA-1 and SCRAM-SHA-256 mechanisms hash the passwords in the client plugin; however, all other data is in cleartext. If possible, use with encrypted connections.
  • The PLAIN mechanism sends the password in cleartext. Use encrypted connections with the PLAIN mechanism .

This plugin requires a version of MySQL Connector/J between 5.1.39 and the latest 5.1.x. It can't use MySQL Server or MySQL Connector/J 8.0 or later.

To download the plugin .jar file, choose one of the following options:

  1. Select the .jar file from the download site.
  2. Save it to a local directory. Refer to the directory as needed.
  1. Include the MongoSQL Authentication Plugin for MySQL Connector/J library in the CLASSPATH. The Maven coordinates are:

    See also:

    To learn more about Maven, refer to its documentation site.

  2. Include MySQL Connector/J in the CLASSPATH. The Maven coordinates are:

  3. Add the authentication plugin in the MySQL connection string:

    See also:

    To learn about the authenticationPlugins query parameter, see the MySQL documentation.

    You may also specify the authentication mechanism and authentication source as a query parameter on the username.

    Default Value
    Authentication mechanism
    Username and Password (SCRAM-SHA-1).
    Authentication source
    • admin for Username and Password (SCRAM-SHA-1)
    • $external for LDAP (PLAIN)

    Specify an authentication mechanism:


    Specify an authentication source using default authentication mechanism:

Give Feedback
© 2021 MongoDB, Inc.


  • Careers
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2021 MongoDB, Inc.