xxxxxxxxxx
For DBeaver users:
1) Right click your connection, choose "Edit Connection"
2) On the "Connection settings" screen (main screen) click on "Edit Driver Settings"
3) Click on "Connection properties", (In recent versions it named "Driver properties")
4) Right click the "user properties" area and choose "Add new property"
5) Add two properties: "useSSL" and "allowPublicKeyRetrieval"
6) Set their values to "false" and "true" by double clicking on the "value" column
xxxxxxxxxx
jdbc:mysql://localhost:3306/db?allowPublicKeyRetrieval=true&useSSL=false