Broadcom API Developer Portal - "java.sql.SQLException: Access denied for user xxxxx" ERROR when special characters are used in MySQL user's password
search cancel

Broadcom API Developer Portal - "java.sql.SQLException: Access denied for user xxxxx" ERROR when special characters are used in MySQL user's password

book

Article ID: 232405

calendar_today

Updated On:

Products

CA API Developer Portal

Issue/Introduction

As part of Portal implementation, a privileged user needs to be created on the target external MySQL server. If the database requires DB user's password to comply complexity standards, special characters are used in the password.

This may cause a problem during Portal deployment, where a connection to the external database fails.

Reviewing portal_db-upgrade service logs, may show the following error:

portal_db-upgrade    |   at liquibase.integration.commandline.Main.main(Main.java:103)
portal_db-upgrade    | Caused by: liquibase.exception.DatabaseException: java.sql.SQLException: Access denied for user '<username>@'<###.###.###.###>' (using password: YES)
portal_db-upgrade    |   at liquibase.database.DatabaseFactory.openConnection(DatabaseFactory.java:247)
portal_db-upgrade    |   at liquibase.database.DatabaseFactory.openDatabase(DatabaseFactory.java:151)
portal_db-upgrade   |   at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:85)
portal_db-upgrade    |   ... 3 more

 

Environment

API Developer Portal 5.x/MySQL 5.x/8.x

Cause

Although MySQL has no problem with special character to be used in user's password ( for e.g. \.[]{}()<>*+-=!?^$| ), the underlying Java/Portal installation scripts will require those characters to be escaped (\) , otherwise the password will be truncated right before the special character is located.

Resolution

Edit <portal path>/conf/portal.conf file and escape (\) special characters in the line PORTAL_DATABASE_PASSWORD=<value> 

Example:

From 

PORTAL_DATABASE_TYPE=mysql
PORTAL_DATABASE_HOST=<HostName>
PORTAL_DATABASE_PORT=3306
PORTAL_DATABASE_USERNAME=<username>
PORTAL_DATABASE_PASSWORD=Test123Oz$u*L

To

PORTAL_DATABASE_TYPE=mysql
PORTAL_DATABASE_HOST=<HostName>
PORTAL_DATABASE_PORT=3306
PORTAL_DATABASE_USERNAME=<username>
PORTAL_DATABASE_PASSWORD=Test123Oz\$u*L