API Gateway: Cannot Create Database Connection to Azure MySQL
search cancel

API Gateway: Cannot Create Database Connection to Azure MySQL

book

Article ID: 189206

calendar_today

Updated On:

Products

CA API Gateway API SECURITY

Issue/Introduction

We are provisioning gateways in Azure using Azure MySQL PaaS.  We are able to connect to the database using: 

curl -v telnet://hostname.mysql.database.azure.com:3306 and

mysql -u user@hostname -h hostname.mysql.database.azure.com -p

However, we we try to create the database we are getting below error.  We are connecting to the database using admin account which has full permissions.

Error creating database when saving configuration 'Cannot create database: 'The connection string may not be right. Please visit portal for references.' [code:28,000, AUTHORIZATION_FAILURE]'

Environment

API Gateway: 9.2 CR10, 9.3 CR04, 9.4+
Database: Azure MySQL

Resolution

The gateway DB user needs to be 'gateway@hostname' so it can connect to the Azure DB. Your DB connection details should look like the following:

Database Host = hostname.mysql.database.azure.com
Database Port = 3306 
Database Name = ssg 
Database Username = gateway@hostname
Administrative Database Username = admin@hostname