I'm learning Django with MySQL as backend. I installed Oracle's mysql connector to connect with mysql. However, when I run python manage.py
I got this error
Traceback (most recent call last): File "C:\Python33\lib\site-packages\django\db\backends\mysql\base.py", line 14, in import MySQLdb as Database ImportError: No module named 'MySQLdb'
That's a bit weird. I was thinking if I installed mysql connector/python I dont need MySQLdb anymore.
Could anyone help explain? Thanks!
My database setting:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': "djangolearn",
'USER': 'root',
'PASSWORD': '',
'HOST': '127.0.0.1',
'PORT': '3306',
}}
}
If you're using Oracle's connector, you need to use their Django db backend.
See their documentation.
Try: pip install mysql-python
If that does not work: make sure you can connect to your database (use phpmyadmin or mysql workbench to test that)