AWS Data Pipeline RDS MySQL to S3 - Unable to establish connection to jdbc:mysql:

Error when Data Pipeline tries to connect to MySQL 8:

amazonaws.datapipeline.database.ConnectionFactory: Unable to establish connection to jdbc:mysql://<host> Could not create connection to database server.

Caused by: java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.

Cause is:

Connector/J" that is installed by AWS Data Pipeline does not work. You will need to replace it by adding your own external JDBC driver

Prerequisites for the new data pipeline

The MySQL JDBC driver "Connector/J" that is installed does not work. 

      You will need to download the correct version from Oracle.

        https://downloads.mysql.com/archives/c-j/

        Product Version

            Select 5.1.48

        Operating System

            Select Platform Independent

        Download the .tar.gz file to your local machine.

     Download connector J

        tar -xzf mysql-connector-java-5.1.48.tar.gz

        cd mysql-connector-java-5.1.48

        pwd : record the location of the driver file

        Goto AWS S3 and upload the mysql-connector-java-5.1.48.jar to a bucket and prefix 

            where it will be safely kept for use in the pipeline.

 

After creating the pipeline, you will need to add a few additional fields.

  •   Select the new Pipeline in the List Pipelines page and click Edit Pipeline.

     Edit Pipeline

  •   Click the Others tab in the right panel navigation to expose the Other fields.
  •   Under "rds_mysql," click the Add an optional field...
  •   Select the "Jdbc Driver Jar Uri" field.

           JDBC

  •   Enter the location of the driver you uploaded in prerequisites
     s3://<your bucket name>/<your prefix name>/mysql-connector-java-5.1.48-bin.jar
  •   Again under rds_mysql click the Add an optional field...
  •   Select the Database Name field.

     Database Name

  •   Enter the MySQL schema database name as entered in Parameters section above (<database name>) when creating the pipeline.