I have got the following error:
Traceback (most recent call last): File "C:\Python27\databasepy.py", line 1, in import MySQLdb File "C:\Python27\lib\site-packages\MySQLdb__init__.py", line 19, in import _mysql ImportError: DLL load failed: %1 is not a valid Win32 application.
While executing the following code:
import MySQLdb
from MySQLdb import Error
try:
db = MySQLdb.Connect(host="localhost",port=3306,user="root",passwd="Azmat@123",db="test")
cursor=db.cursor()
cursor.execute("SELECT VERSION()")
data=cursor.fetchone()
print "Database version :%s " %data
db.close()
except Error as er:
print er