Can not connect to MySQL

39 views
Skip to first unread message

timda...@yahoo.com

unread,
Oct 17, 2013, 3:47:34 PM10/17/13
to django...@googlegroups.com
Hi, I am new to Django and try to connect to database MySQL I get this message: Can anyone help? thanks in advance.

Unhandled exception in thread started by <bound method Command.inner_run of <django.contrib.staticfiles.management.commands.runserver.Command object at 0x3026810>>
Traceback (most recent call last):
  File "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/core/management/commands/runserver.py", line 92, in inner_run
    self.validate(display_num_errors=True)
  File "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/core/management/base.py", line 280, in validate
    num_errors = get_validation_errors(s, app)
  File "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/core/management/validation.py", line 28, in get_validation_errors
    from django.db import models, connection
  File "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/db/__init__.py", line 40, in <module>
    backend = load_backend(connection.settings_dict['ENGINE'])
  File "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/db/__init__.py", line 34, in __getattr__
    return getattr(connections[DEFAULT_DB_ALIAS], item)
  File "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/db/utils.py", line 93, in __getitem__
    backend = load_backend(db['ENGINE'])
  File "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/db/utils.py", line 27, in load_backend
    return import_module('.base', backend_name)
  File "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/db/backends/mysql/base.py", line 17, in <module>
    raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb


François Schiettecatte

unread,
Oct 17, 2013, 4:05:55 PM10/17/13
to django...@googlegroups.com
Could be a number of things:

- mysql may not be installed.

- mysql is installed but in a non-standard location.

- mysql is the wrong version.

You can start tracking down these issues by running mysql_config

François
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/86dad6e4-ba16-489c-9fa8-d1722c089d11%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Thomas Orozco

unread,
Oct 17, 2013, 4:08:24 PM10/17/13
to django...@googlegroups.com
Most likely it's the MySQLdb package (https://pypi.python.org/pypi/MySQL-python) that's not installed.

Installing it *will* require installing libmysql-client first, though.


Charly Román

unread,
Oct 17, 2013, 4:09:30 PM10/17/13
to django...@googlegroups.com
Install mysql module:

sudo pip install mysql-python


2013/10/17 <timda...@yahoo.com>:

Larry Martell

unread,
Oct 17, 2013, 4:09:47 PM10/17/13
to django...@googlegroups.com
Did you install MySQLdb?  
Reply all
Reply to author
Forward
0 new messages