连接方案1: conn = pymssql.connect(host='127.0.0.1', port=1433, user='sa', password='password', database='b2c') cur = conn.cursor() cur.execute('SELECT * FROM [dbo].[user] where uid=%s',(3,)) row = cur.fetchall() print(row) cur.close() conn.close() 1.下载安装…