SSL connection error to MySQL with Python 3.7. InterfaceError: SSL connection error: Failed to set ciphers to use

喜你入骨 提交于 2020-08-06 05:12:12

问题


I am new to MySQL and I have recently set up a server for learning and testing purposes. The end goal is to be able to connect to MySQL using ODBC for other computers and with a Python connector from the local computer. I tried to set up the basic connection to MySQL in python with the following code:

import mysql.connector

myDb = mysql.connector.connect(
             host ='localhost',
             user ='username',
             password = 'password');

print(myDb);

But I get the following error message:

InterfaceError: SSL connection error: Failed to set ciphers to use.

There are no SSL certificates created or configured in MySQL, but it keeps giving me this response.


回答1:


try adding flag 'use_pure' :

db_connection = mysql.connector.connect(host='127.0.0.1', user='root', password='password123',use_pure=True)


来源:https://stackoverflow.com/questions/55121990/ssl-connection-error-to-mysql-with-python-3-7-interfaceerror-ssl-connection-er

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!