MySQL: JDBC_06: Failed to Initialize Connection Pool: Access Denied Error
A pipeline which is using a JDBC stage to access a MySQL database generates an error int he following form:
START_ERROR: JDBC_06 - Failed to initialize connection pool: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Access denied for user 'username'@'hostname' (using password: YES)
The pipeline is using a configured Connection in Control Hub, and when the Test Connection button is used in the Edit Connection window, the connection succeeds. Only when it is used in an actual pipeline does it fail.
This behavior occurs when two conditions are met:
- MySQL is configured to require SSL. This condition can be met in one of three ways:
- The MySQL user is configured with the REQUIRE SSL option.
- The “
requireSSL” property has been configured in the JDBC Additional Configuration Properties int he JDBC stage, with the value “
requireSSL=true” has been added to the JDBC connection string in the Connection configuration.
- The “
com.streamsets.pipeline.lib.jdbc.disableSSL“ property in sdc.properties is set to “
The error message occurs because the JDBC stages check for the property “
com.streamsets.pipeline.lib.jdbc.disableSSL=true“ and if it is found they attempt to disable SSL for the connection. In the case of MySQL, this is done by adding “
useSSL=false” to the connection properties when the connection pool is initialized. As MySQL has been configured to requireSSL (by one of the methods under condition 1 above), MySQL will deny access.
This does not occur in the Test Connection case because SSL is not disabled by this property in the connection test.
com.streamsets.pipeline.lib.jdbc.disableSSL“ property should only be set to “
true“ when there are pipelines running on the Data Collector which cannot use SSL. If no pipelines being run on the Data Collector require a non-secure configuration, this property should be set to “
false”, which will resolve the issue.
However, if there are pipelines running on the Data Collector which do require a non-SSL connection, this property should not be changed (as it will break those pipelines). In this case, it is possible to override this property on a per-stage basis by adding the “
useSSL=true“ property in the Additional JDBC Connection Properties of the JDBC stage.
To override the property, select the JDBC stage where the error is occurring and perform the following:
- Choose "Configuration" in the stage properties (at the bottom left of the window)
- Select the "JDBC" tab.
- Select “Show Advanced Options” if the advanced options are not already shown.
- Scroll down to the "Additional JDBC Configuration Properties" (at the bottom of the JDBC tab) and click the "+" button to add a new property.
- In the "Name" field, enter "
- In the "Value" field, enter "