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


MySQL Connector/J Developer Guide  /  ...  /  Connecting Using Multifactor Authentication

6.12.3 Connecting Using Multifactor Authentication

Multifactor authentication (MFA) is the use of multiple authentication factors during an authentication process. MySQL Server supports MFA for up to three authentication factors.

Connection to MySQL Server with MFA is supported by Connector/J. When authenticating user accounts that require multiple passwords, up to three passwords can be specified using the Connector/J connection properties password1, password2, and password3 . This is a sample connection string that uses the three connection properties for passwords:

jdbc:mysql://localhost/db?user=johndoe&password1=password&passsword2=password&password3=password

The following apply when using the connection properties for passwords:

  • password1, password2, and password3 are passwords for authentication factors 1, 2, and 3, respectively, as described in Getting Started with Multifactor Authentication.

  • If any of the authentication factors (say, factor N) does not require a password, the corresponding password (passwordN) is ignored, even if supplied.

  • Not specifying the corresponding password for an authentication factor that requires a password is equivalent to supplying an empty password for the factor.

  • password and password1 are taken as synonyms except when both are supplied, in which case password1 overrides password.