Spring Cloud Data Flow database connection fails with MySQL 8 on AWS
search cancel

Spring Cloud Data Flow database connection fails with MySQL 8 on AWS

book

Article ID: 404701

calendar_today

Updated On:

Products

VMware Tanzu Spring Runtime

Issue/Introduction

Customer attempted a new install of SCDF for Kubernetes version 1.65, pointing to an RDS MySQL database.  

In the data-flow application-database.yaml customer used these settings:

spring:
  datasource:
    url: jdbc:mysql://example-app-cluster.<cluster>.<region>.rds.<domain>:3306/dataflow
    username:
    password:
    driverClassName: org.mariadb.jdbc.Driver
    testOnBorrow: true
    validationQuery: "SELECT 1"


However, they got this error:

Driver org.mariadb.jdbc.Driver does not accept jdbcUrl jdbc:mysql://example-app-cluster.<cluster>.<region>.rds.<domain>:3306/dataflow

If they change "mysql" in the url to "mariadb," the "driver does not accept" error goes away, but there is a fly away error when trying to connect to the database.

Resolution

This connection syntax has been tested successfully on MySQL 8:

jdbc:mysql://${db-hostname}:${db-port}/${db-name}?allowPublicKeyRetrieval=true&useSSL=false&autoReconnect=true&permitMysqlScheme