Documentation Home
Connectors and APIs Manual
Download this Manual
PDF (US Ltr) - 4.1Mb
PDF (A4) - 4.1Mb


3.5.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 for release 8.0.28 and later. 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.