JDBC连接数据库时出现Public Key Retrieval is not allowed错误
在项目的JDBC连接数据库的url中,加上allowPublicKeyRetrieval=true参数
就可以连接到数据库了
String url = "jdbc:mysql://localhost:3306/mycompany?&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true";
String url = "jdbc:mysql://localhost:3306/mycompany?&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true";