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
This is a sample connection string that uses the three
connection properties for passwords:
The following apply when using the connection properties for passwords:
password3are 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 (
password) 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.