MySQL Connector/J 8.0 Developer Guide

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 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: