gpt4 book ai didi

mysql.connector.errors.InterfaceError : 2026 (HY000)

转载 作者:行者123 更新时间:2023-11-29 16:10:36 25 4
gpt4 key购买 nike

从 homebrew python 切换到 anaconda python 后,之前可以正常工作的代码现在出现以下错误:

mysql.connector.errors.InterfaceError: 2026 (HY000): SSL connection error: SSL_CTX_set_tmp_dh failed

这是我的代码:

import mysql.connector

mydb = mysql.connector.connect(
host = "localhost",
user = "root",
passwd = "123456root",
database = "tourists"
)

mycursor = mydb.cursor()

#mycursor.execute("CREATE DATABASE tourists")

#mycursor.execute("CREATE TABLE clients(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,firstname VARCHAR(255), lastname VARCHAR(225), year VARCHAR(5), room VARCHAR(2))")

mycursor.execute("ALTER TABLE clients ADD COLUMN telefon")

mycursor.execute("ALTER TABLE clients ADD COLUMN parere")

mycursor.execute("ALTER TABLE clients ADD COLUMN localitate"

最佳答案

我猜想 anaconda 中的 mysql 连接器与 openssl 存在一些兼容性问题。解决办法是降级openssl。

conda install openssl=1.0.2p

请参阅此主题以获取更多信息:

https://github.com/ContinuumIO/anaconda-issues/issues/10646

关于mysql.connector.errors.InterfaceError : 2026 (HY000),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55294842/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com