IG902通过自定义函数,连接sql server数据库报错:
python: iconv.c:340: tds_iconv_open: Assertion `ret == 0' failed.
from common.Logger import logger
from datetime import datetime import time import pymssql def main(): host1 = '192.168.1.77' user1 = 'sa' passwd1 = 'As123456.' db1 = 'test' charset1 = 'utf8' connect1 = pymssql.connect(host=host1,user=user1,password=passwd1,database=db1,charset=charset1) cursor1 = connect1.cursor() logger.info(time.strftime('%Y-%m-%d %H:%M:%S') + ' sql connect ok')
import pymssql 没报错,说明是有pymssql库可以用的