DB-Lib error message 20002, severity 9

reprinted
Db-lib error message 20002, severity 9
complete error response: 20002, b ‘db-lib error message 20002, severity 9:\nAdaptive Server connection failed (i0.185.43.12:1433)\n ‘
Problem description:
In Python, using PSMSSQL to connect to a remote database, error reported. It is no problem to connect the remote machine through other machines, and it is also no problem to connect the remote machine with other tools (SQLCMD, Naticat, etc.) on my own machine, and locate the problem in the use of PyMSSQL library on this machine
Solutions:
Specify charset=”CP936″ at each pymssql.connect

conn = pymssql.connect(host='localhost',server='.',user='sa',password='XXXX', database='aaa',charset="CP936")

Read More: