0

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.

2
  • There is a mysql package for django. Install it using pip. pip install mysql-python. Commented Aug 1, 2016 at 17:57
  • I have already done that, but I'm getting error. Commented Aug 1, 2016 at 18:01

1 Answer 1

1

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
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.