NEW CA API Developer Portal fails to start with JDBC failure com.mysql.cj.jdbc.Driver. Public Key Retrieval is not allowed
search cancel

NEW CA API Developer Portal fails to start with JDBC failure com.mysql.cj.jdbc.Driver. Public Key Retrieval is not allowed

book

Article ID: 434800

calendar_today

Updated On:

Products

CA API Developer Portal

Issue/Introduction

New installation (create Database) may fail with "com.mysql.cj.jdbc.Driver.  Public Key Retrieval is not allowed"

The Developer portal logs you can observe,

liquibase.exception.DatabaseException: Connection could not be created to jdbc:mysql://address=(protocol=tcp)(type=master)(host=myHost.com)(port=3306)/portal?createDatabaseIfNotExist=true&failOverReadOnly=false&serverTimezone=UTC with driver com.mysql.cj.jdbc.Driver.  Public Key Retrieval is not allowed

Environment

CA API Developer Portal 5.4 

Mysql 8.4 user with caching_sha2_password ( and mysql_native_password disabled).

Cause

 

 

Resolution

Mysql will need to have mysql_native_password user to create / upgrade the database which will be fixed in a future Portal version. 

Steps to enable mysql_native_password (which is deprecated and disabled by default in 8.4 but not removed).

1) Enable it following the mysql docs, via nano editor

Doc: https://dev.mysql.com/doc/refman/8.4/en/native-pluggable-authentication.html

Updated Value in the [mysqld] section of the my.cnf:

mysql_native_password=ON

2) Restarted mysql.

# service mysql restart

3) Alter portal DB user to use mysql_native_plugin

# mysql

mysql> ALTER USER 'myUser'@'myHost' IDENTIFIED WITH mysql_native_password BY '########';

 

After enabling this you should be able to start up the portal.