在连接数据库的url中,加上allowPublicKeyRetrieval=true

mysql8.0后url变为了

jdbc:mysql://localhost:3306/user?characterEncoding=utf8&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true

相关文章: