前言:
java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed
这个问题主要是Mysql8.0链接方式有了个变化。
需要修改客户端连接配置方式的:
当前应该添加上:
&useSSL=false&allowPublicKeyRetrieval=true
具体的配置详情:
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/db_user?serverTimezone=GMT%2B8&useSSL=false&allowPublicKeyRetrieval=true&useSSL=false
spring.datasource.username=root
spring.datasource.password=123456
java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110) ~[mysql-connector-java-8.0.22.jar:8.0.22]
at com.mysql.cj.jdbc.exceptions.SQLErr