【问题标题】:Python MySQLdb cannot connect to server, SSL IssuePython MySQLdb 无法连接到服务器,SSL 问题
【发布时间】:2019-10-16 15:24:03
【问题描述】:

_mysql_exceptions.OperationalError: (2026, 'SSL connection error: SSL_CTX_set_tmp_dh failed')

当我尝试运行连接到我的 SQL 服务器的脚本时被抛出。 我通过 conda 安装了 MySQLdb。我读到这可能是一个 openssl 问题,但我也无法降级。

【问题讨论】:

    标签: python openssl conda mysql-python


    【解决方案1】:

    基于This answer

    我得到了答案:'https://dev.mysql.com/doc/refman/5.7/en/data-directory-initialization.html'

    'shell> bin/mysql_ssl_rsa_setup'

    如果要部署自动支持安全连接的服务器,请使用 mysql_ssl_rsa_setup 实用程序创建默认 SSL 和 RSA 文件

    More information here

    【讨论】:

      【解决方案2】:

      我能够通过使用mysql.connector 而不是在我的python 脚本中导入MySQLdb 来解决这个问题

      【讨论】:

        猜你喜欢
        • 2020-09-13
        • 2012-06-22
        • 2012-12-24
        • 2011-03-11
        • 2014-07-23
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多