Ameya Joshi
Ameya Joshi

Reputation: 31

Error loading MySQLdb

I'm facing problem while connecting mysql database in django. I'm getting error as

 raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: DLL load failed: %1 is not a valid Win32 application.

I have set database setting as

DATABASES = {
'default': {
    'ENGINE': 'django.db.backends.mysql', 
    'NAME': 'db_name',
    'USER': 'user',
    'PASSWORD': 'password',
    'HOST': 'localhost',   # Or an IP Address that your DB is hosted on
    'PORT': '3306',
}
}

I don't know where I'm making mistake.

Upvotes: 0

Views: 751

Answers (1)

Nikhil Saxena
Nikhil Saxena

Reputation: 39

Probably you are using 64bit python/mysql but pip had installed the 32bit mysql-python.

Download the 64bit mysql-python from the link [The link only has support for python 2.7]: http://www.codegood.com/archives/129

and run the following:

$ pip install path_to_64bit-mysql-python.zip

Upvotes: 1

Related Questions