其他分享
首页 > 其他分享> > (20002, b'DB-Lib error message 20002, severity 9:\nAdaptive Server connection failed (127.0.0.

(20002, b'DB-Lib error message 20002, severity 9:\nAdaptive Server connection failed (127.0.0.

作者:互联网

使用python 3.7 

pymssql 连接本地mysql 5.6 报错

 

 

解决:参考

https://www.cnblogs.com/springbrotherhpu/p/11503139.html

https://blog.csdn.net/llx1026/article/details/79579572

 

1.在https://sourceforge.net/projects/freetdswindows/ 下载 windows 的freetds

2. 解压,cmd 进入 F:\FreeTDS-1.00-x86\freetds-1.00\bin

3. 尝试连接 报错

 

 

问题是

Adaptive Server connection failed
OS error 10060, "Unknown error"

 

4. 解决

 我傻了。。。

pymssql 是对于 SQL SERVER的

而要用 mysql,使用 pymysql  。。。。。太愚蠢了

 

CONFIG = {
    "host": '127.0.0.1',
    "user": 'erio',
    "pwd": '123',
    'db': 'Library'
}


conn = pymysql.connect(CONFIG['host'], CONFIG['user'],CONFIG['pwd'])

这样连接成功。

标签:127.0,severity,0.1,mysql,报错,20002,https,error,CONFIG
来源: https://www.cnblogs.com/lqerio/p/12180220.html