今天在整合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方案解決該問題。