Public Key Retrieval is not allowed错误

今天在整合SSM时,出现错误Public Key Retrieval is not allowed,百度多次后解决办法最终解决办法有两种:

1. mysql5及之前的版本使用的是旧版驱动"com.mysql.jdbc.Driver",mysql6以及之后的版本需要更新到新版驱动,对应的Driver是"com.mysql.cj.jdbc.Driver",但是这个驱动错误的信息是"Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.",排除这个原因。
2. 连接数据库的url中,加上allowPublicKeyRetrieval=true参数。

最终,第2方案解决该问题。

猜你喜欢

转载自www.cnblogs.com/wanguncle/p/11432847.html