(20002, b'DB-Lib error message 20002, severity 9: Adaptive Server connection failed (127.0.0.1:3306) ')

使用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-x86freetds-1.00in

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'])

这样连接成功。

原文地址:https://www.cnblogs.com/lqerio/p/12180220.html