标签:mssql pytho lin free apt 0.12 修改 class imp
import pymssql #如果是linux系统建议用sudo apt-get install freetds-dev更新一下 conn = pymssql.connect(host=‘10.12.60.34‘, user=‘sa‘, password=‘h3c.com!‘,database=‘cloudos‘) # 如果和本机数据库交互,只需修改链接字符串 # conn=pymssql.connect(host=‘.‘,database=‘cloudos‘) cur = conn.cursor() cur.execute(‘SELECT * FROM dbo.vm_infor‘) print(cur.fetchall()) cur.close() conn.close()
标签:mssql pytho lin free apt 0.12 修改 class imp
原文地址:http://www.cnblogs.com/Bingo0-python/p/7692643.html