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.

asked Aug 1, 2016 at 17:50
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
answered Feb 21, 2017 at 8:51
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.