ITeye博客

mysql-python 异常

baitian · 2008-08-29 18:18 · Markdown

centos5 python2.5.2 mysql-python1.2.2


import MySQLdb
import sys
db=MySQLdb.connect(user="##",passwd="##",db="##",host="######",port=3306)
cur=db.cursor(MySQLdb.cursors.Cursor)
sql="show tables"
cur.execute(sql)

执行到最后一句时,抛出异常了: Traceback (most recent call last): File "", line 1, in File "MySQLdb/cursors.py", line 166, in execute self.errorhandler(self, exc, value) File "MySQLdb/connections.py", line 35, in defaulterrorhandler raise errorclass, errorvalue SystemError: NULL object passed to Py_BuildValue

找了一天,发现这方面的资料几乎没有,不知道有人碰到过这样的情况没?

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。