使用Python 3.7的MySQL的SSL连接错误. InterfaceError:SSL连接错误:无法设置要使用的密码

问题描述:

我是MySQL的新手,我最近设置了用于学习和测试目的的服务器.最终目标是能够使用ODBC(用于其他计算机)和来自本地计算机的Python连接器连接到MySQL.我尝试使用以下代码在python中建立与MySQL的基本连接:

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连接错误:无法设置要使用的密码.

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

在MySQL中没有创建或配置SSL证书,但是它一直在给我这个响应.

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

尝试添加标志'use_pure':

try adding flag 'use_pure' :

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