IBM Support

Error: Could not connect to: 'jdbc:mysql://192.168.0.1:3306/db_name?autoReconnect=true' when attempting to create a MySQL DataSource without an SSL Connection

Troubleshooting


Problem

When attempting to test connection after creating a datasource definition in Guardium, an error like the one described in https://www-01.ibm.com/support/docview.wss?uid=swg21685610 appears, but without the SqlState message.

Sample error message:

Could not connect to: 'jdbc:mysql://192.168.0.1:3306/db_name?autoReconnect=true' for user: 'test_conn_MYSQL(Access Policy)'. DataSourceConnectException: Could not connect to: 'MYSQL test_db 192.168.0.1:3306' for user: 'guardium'. Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.

Cause

After following the technote highlighted above, if the error is still observed, this is an indication of Guardium attempting to connect using SSL but not being able to do so.

If the SQLState message is not observed, there is likely no issue with the parameters defined in the definition.

Environment

Please ensure an SSL connection is not being enforced by the MySQL server before performing the resolution below.

Resolving The Problem

Copy out the connection string from the error message and append useSSL=false at the end. Add this to the Custom URL Field in the definition template. Example as follows:

jdbc:mysql://192.168.0.1:3306/db_name?autoReconnect=true&useSSL=false

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSMPHH","label":"IBM Security Guardium"},"Component":"","Platform":[{"code":"PF016","label":"Linux"}],"Version":"9.5;10.1.x;10.5","Edition":"","Line of Business":{"code":"LOB24","label":"Security Software"}}]

Document Information

Modified date:
01 November 2018

UID

ibm10738199