我在 kubernetes 上部署的 MySQL 中的 RSA 公钥有问题

问题描述 投票:0回答:1

我尝试将数据从 Azure Databricks 写入到在 aks 中创建的 MySQL 数据库。每次我尝试时,都会收到错误消息“java.sql.SQLTransientConnectionException:无法连接到地址=(主机= xx.xxx.xxx.xx)(端口= 3306)(类型= master):无法读取服务器RSA公共文件中的密钥:serverRsaPublicKeyFile=public_key.pem” enter image description here

但是我可以通过容器 bash 看到公钥文件

enter image description here

密钥是使用“mysql_ssl_rsa_setup”生成的。

由于容器没有编辑器,我尝试使用以下方法修改 mysql_config:

echo ssl-key=/bin/private-key.pem > /bin/mysql_config echo ssl-cert=/bin/public-key.pem > /bin/mysql_config

但是我无法检查线条是否正确应用,并且我会收到错误。

mysql pyspark rsa azure-databricks azure-aks
1个回答
0
投票

java.sql.SQLTransientConnectionException:无法连接到地址=(主机= xx.xxx.xxx.xx)(端口= 3306)(类型= master):无法从文件读取服务器RSA公钥:serverRsaPublicKeyFile = public_key.pem

您应该将客户端选项添加到 MySQL 连接字符串来解决上述错误:

  • allowPublicKeyRetrieval=true
    允许客户端自动向服务器请求公钥。

  • useSSL=false
    = 这将禁用 SSL 并抑制 SSL 错误

您还可以在 GitHub 上看到类似的issue以获取更多理解。

© www.soinside.com 2019 - 2024. All rights reserved.