I'm trying to use MySQL in Python. I have installed the MySQL adapter (MySQL-python-1.2.4b4.win32-py2.7) for Python, but when I try to import the MySQLdb module (import MySQLdb) with command prompt I receive the following output:
Traceback (most recent call last):
File "", line 1, in
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.
Would anybody know, what could be wrong?
解决方案
You need to have a 32bit version of Python to use this adapter. Which version are you actually using ?