RedJini Blog

뒤로 검색

[python] Python에서 MSSQL 사용하기

2008/03/06 14:34

Python module:
    http://pymssql.sourceforge.net

장애 1)

    Traceback (most recent call last):
      File "/email_server/src/server/spam/xspam_centerlog.py", line 8, in ?
      File "/usr/local/python2.4.2/lib/python2.4/site-packages/pymssql.py", line 30, in ?
        import _mssql
    ImportError: /usr/local/python2.4.2/lib/python2.4/site-packages/_mssql.so: undefined symbol: dbcolinfo

조치 1)

    http://www.freetds.org/software.html 에서 FreeTDS-stable.tgz 을 다운받아 설치한다.
    직접 다운받기 : http://ibiblio.org/pub/linux/alpha/fre ··· able.tgz

장애 2)   

    Traceback (most recent call last):
      File "/email_server/src/server/spam/xspam_common.py", line 79, in xspam_main
      File "/email_server/src/server/spam/xspam_centerlog.py", line 20, in proc_main
      File "/usr/local/python2.4.2/lib/python2.4/site-packages/pymssql.py", line 328, in connect
        con = _mssql.connect(dbhost, dbuser, dbpasswd)
    error: DB-Lib error message 20009, severity 9:
    Server is unavailable or does not exist.

조치 2)

  dbhost에 port까지 명시한다.

  con = pymssql.connect( host='192.168.0.10:1433', user='sa', password='', database='temp')
  cur = con.cursor()

Tags

MSSQL, Python
이 페이지는 Textcube 1.9.3 : poco a poco 로 구동됩니다 데스크탑 화면