Hi All,

I've just tried to get going with Django using MySQL, but linking them has been a nasty headache. I am using Python v3.5, Django v1.9 and MySQL 5.6.

I've definately got MySQL/Python talking, but Django always has the problem:

 File "X:\Program Files\Python\lib\site-packages\django-1.9-py3.5.egg\django\db\backends\mysql\base.py", line 25, in <module>
 import MySQLdb as Database
ImportError: No module named 'MySQLdb'

Any ideas much appreciated!

Matt

Hi, check the documentation:

the latest release of MySQLdb (1.2.5) doesn’t support Python 3. In order to use MySQLdb under Python 3, you’ll have to install mysqlclient instead.

But mysqlclient does not support Python 3.5:

MySQL-3.23 through 5.5 and Python-2.7, 3.3-3.4 are currently supported. PyPy is supported.

So, I think, you have to downgrade to Python 3.4 or try the MySQL Connector/Python which according to documentation:

It may not support the most recent releases of Django.

This article has been dead for over six months. Start a new discussion instead.