When connecting to a MySQL database via JDBC, there will occur below connection error message from TAC or Talend tMysqlConnection, tMysqlInput and tMysqlOutput components.
java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed
Root Cause
The error message java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed typically occurs when you're trying to connect to a MySQL database using JDBC and the connection URL is not correctly configured to allow public key retrieval for SSL connections. This is a regular setting when using MySQL 8.0+ with certain security configurations.
Resolution
Add client option to your connection URL mysql-connector allowPublicKeyRetrieval=true to allow the client to automatically request the public key from the server.