안녕하세요, 저는 WAMP 서버 (MySQL, apache, php)를 설치했으며 "Python"을 별도로 설치했습니다. 이제 파이썬 코드를 사용하여 해당 데이터베이스에 연결하려고합니다.Wamp Server and Python
이 내 파이썬 코드 :
#!C:\Python32\python.exe
import sys
import os
import cgi
import MySQLdb
import cgitb
import SecureDb
cgitb.enable()
print ("Content-type: text/plain\n\n");
conn= MySQLdb.connect(host = SecureDb.host ,user =SecureDb.user ,passwd=SecureDb.password ,db=SecureDb.database)
cursor=conn.cursor()
cursor.execute("select * from register where Name='Subburaj'")
result=cursor.fetchall()
cursor.close()
conn.close()
하지만이 오류를 보여주고있다 :
Traceback (most recent call last):
File "C:\Users\Ponmani\Desktop\test.cgi", line 5, in <module>
import MySQLdb
File "C:\Python32\lib\site-packages\MySQLdb\__init__.py", line 17, in <module>
from release import __version__, version_info, __author__
ImportError: No module named release
사람이 사전에 this.Thanks를 해결하기 위해 좀 도와주세요이 문제를 통해 제공된 경우.
이것은 홀수 라인입니다. 추적에서 2가 파일의 2 행과 일치하지 않습니다. 우리가 보여주는 것은'C : \ Users \ Ponmani \ Desktop \ test.cgi'의 내용입니까? –
미안 David Robinson.. 이제 내 편집 된 게시물을 볼 수 있습니다 .. –