MySQL with pyodbc error

273 views
Skip to first unread message

Phil

unread,
May 15, 2009, 10:07:47 PM5/15/09
to Django users
Hi,

I'm trying Django with MySQL and the pyodbc connector. However, it
appears that Django can only cope with the mysqldb connector. I get a
load of traceback ending with the error:

File "C:\python26\lib\site-packages\django\db\backends\mysql\base.py",
line 13, in <module>
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb
module: No module named MySQLdb

Is there replacement code for pyodbc to get this working?

Cheers
Phil

Karen Tracey

unread,
May 16, 2009, 10:39:01 AM5/16/09
to django...@googlegroups.com

There's MySQLdb.  That's what Django's built-in MySQL backend is coded to use, not pyodbc.  With it, you do not need any special connector (such as MySQL Connector/ODBC) on the database server side, you just need MySQLdb on the client side. 

I don't know of any Django database backends that communicate with MySQL via pyodbc.  The only Django database backend that uses pyodbc that I have heard of is django-pyodbc (http://code.google.com/p/django-pyodbc/), but I believe that one is specific to MS SQL Server.

Karen 
Reply all
Reply to author
Forward
0 new messages