我使用执行以下查询
connection= MySQLdb.connect(host=self.__host, user=self.__db_username, passwd=self.__db_passwd, db=self.__db, charset="utf8", use_unicode=True)
cursor= connection.cursor()
sql= 'SELECT * FROM func1'
cursor.execute(sql)
data= cursor.fetchall()
cursor.close()
connection.close()
func1 = None
if len(data)>0:
func1s = []
for item in data:
func1= db_func1()
#item = data[0]
func1.id = item[0]
func1.title = item[2]
func1s.append(func1)
return func1s
这是第一次,它将被执行,但过了一秒它就会给我错误,我使用的是3306端口
谢谢你的帮助
^{pr2}$
目前没有回答
相关问题 更多 >
编程相关推荐