However I got this error when I ran manage.py migrate in PyDev.The Python Database API is described in PEP 249. MySQL has two prominent drivers that implement this API:
- MySQLdb is a native driver that has been developed and supported for over a decade by Andy Dustman.
- MySQL Connector/Python is a pure Python driver from Oracle that does not require the MySQL client library or any Python modules outside the standard library.
Both drivers are thread-safe and both provide connection pooling. The major difference is that MySQL Connector/Python supports Python 3.
Traceback (most recent call last): File "C:\Python33\lib\site-packages\django\db\backends\mysql\base.py", line 14, in <module> import MySQLdb as DatabaseImportError: No module named 'MySQLdb'
try: import MySQLdb as Databaseexcept ImportError as e: from django.core.exceptions import ImproperlyConfigured raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': "djangolearn", 'USER': 'root', 'PASSWORD': '', 'HOST': '127.0.0.1', 'PORT': '3306', 'CONN_MAX_AGE': 0 # set connection life }}