Mysql 8.x版本连接时报错 java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed
可能需要修改的参数如下:
1.useSSL=false MySQL 8.0 以上版本不需要建立 SSL 连接的,需要显示关闭
2.allowPublicKeyRetrieval=true 允许客户端从服务器获取公钥。
3.serverTimezone=UTC 设置时区,mysql驱动8.0+也要指定时区,不然也可能报错
配置示例如下:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/test?serverTimezone=Hongkong&useUnicode=true&characterEncoding=utf8&useSSL=false&allowMultiQueries=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true</
7272



被折叠的 条评论
为什么被折叠?



