eozzy
eozzy

Reputation: 68650

Configure MySQL to work with Django

Just installed Django (with easy_install) and created a project, but can't get mysql to work.

python manage.py syncdb throws this error:

.....
File "/Library/Python/2.6/site-packages/Django-1.1.1-py2.6.egg/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

I have MAMP installed and path to MySQL is probably: /Applications/MAMP/Library/bin/mysql

Thanks!

Upvotes: 0

Views: 1699

Answers (2)

extraneon
extraneon

Reputation: 23950

The MySQL egg requires a compiler from the dev tools (download XCode from the apple developers site) and a MySQL installation.

If you have installed those, you have set the PATH to include mysql_config.

export PATH=$PATH:/usr/local/mysql-5.1.39-osx10.5-x86_64/bin/

Check the path, as this is the installation on my machine!

After that, you should be able to build the egg with easy_install.

Good google terms are MySQLdb OS X Snow Leopard.

Upvotes: 0

GeeKieR
GeeKieR

Reputation: 35

you need Python library for MySQL access, MySQLdb:

http://sourceforge.net/projects/mysql-python/

Upvotes: 3

Related Questions