Re: Can only connect via JDBC if Workbench first
Posted by: Filipe Silva
Date: September 25, 2020 06:28AM

Hi Bassam,

"useSSL=false" is the culprit.

The default authentication mechanism in MySQL is caching_sha2_password, which requires a secure connection on the first authentication and subsequent authentications are possible from an insecure channel.

So, first time you authenticate with Workbench you add your credentials to the authentication cache. Next time you create a Connector/J connection this cache is used.

If the authentication cache is empty, then you won't be able to connect from Connector/J, unless you enable SSL at least once.

BTW, in Connector/J 8.0 I'd recommend using the connection option 'sslMode' instead of 'useSSL', that exists only for compatibility purposes.


Options: ReplyQuote

Written By
Re: Can only connect via JDBC if Workbench first
September 25, 2020 06:28AM

Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.