1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > MySQL连接报错Public Key Retrieval is not allowed错误

MySQL连接报错Public Key Retrieval is not allowed错误

时间:2019-01-02 17:09:06

相关推荐

MySQL连接报错Public Key Retrieval is not allowed错误

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.Driverurl: jdbc:mysql://127.0.0.1:3306/test?serverTimezone=Hongkong&useUnicode=true&characterEncoding=utf8&useSSL=false&allowMultiQueries=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true

感谢:

/qq_38616503/article/details/111407419

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。