Check out example codes for "com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Public Key Retrieval is not allowed". It will help you in understanding the concepts better.

Code Example 1

jdbc:mysql://localhost:3306/db?allowPublicKeyRetrieval=true&useSSL=false

Learn ReactJs, React Native from akashmittal.com