刚刚还能跑的项目,在我关机休息过后再次启动项目运行出现了下面的报错:(???)
org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed
意思大概是错误查询数据库,不允许公钥检索原来我连接数据库的信息是这样的:
<environments default="development">
<environment id="development">
<transactionManager type="JDBC"/>
<dataSource type="POOLED">
<property name="driver" value="com.mysql.cj.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/ems?useSSL=FALSE&serverTimezone=Asia/Shanghai"/>
<property name="username" value="${username}"/>
<property name="password" value="root"/>
</dataSource>
</environment>
</environments>
为了消除上面的报错,在 jdbc:mysql://localhost:3306/emsuseSSL=FALSE&serverTimezone=Asia/Shanghai这句后面加上&allowPublicKeyRetrieval=true&useSSL=false
就可以解决上面的报错了。。。