java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed

mysql8.x版本的数据库在连接的时候报错java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed
只要在url的后边加上allowPublicKeyRetrieval=true即可

jdbc:mysql://localhost:3306/test?serverTimezone=GMT&allowPublicKeyRetrieval=true&useSSL=false&characterEncoding=utf8;

你可能感兴趣的:(java,IDEA,mybatis,数据库,mysql,java,jdbc)