使用Python 3.7的MySQL的SSL连接错误. InterfaceError:SSL连接错误:无法设置要使用的密码 [英] SSL connection error to MySQL with Python 3.7. InterfaceError: SSL connection error: Failed to set ciphers to use

查看:443
本文介绍了使用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)

这篇关于使用Python 3.7的MySQL的SSL连接错误. InterfaceError:SSL连接错误:无法设置要使用的密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆