Wednesday, May 28, 2014

Re: Mysql DB local socket access errors with mod_wsgi

It's very likely a permissions problem. Webserver processes tend to run under a special username (e.g. www-data) with very limited permissions - it's likely that this user does not have access to the socket file.

HTH

Jirka

-----Original Message-----
From: Henning Sprang <henning.sprang@gmail.com>
Sender: django-users@googlegroups.com
Date: Wed, 28 May 2014 11:28:00
To: <django-users@googlegroups.com>
Reply-To: django-users@googlegroups.com
Subject: Mysql DB local socket access errors with mod_wsgi

Hi,

I'm trying to setup a django production environment with mod_wsgi, and
a local mysql which I want to connect via the socket file.

Without wsgi the app runs and connects to the database.

When running it via wsgi, I get:

OperationalError

(2002, "Can't connect to local MySQL server through socket
'/var/run/mysqld/mysqld.sock' (13)")

It might be relevant that I'm running the app and the db in Docker
containers, sharing the directory with the socket file in between
them. On the other hand, as running the app manually with runserver
works well, I guess it must be something else.

I tried every imaginable configuration, from the simplest described in
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/modwsgi/
to just about anything described there, the socket file defintely
exists at this path, and I also tried to explicitly allow apache
access with a directory/files directive in apache - no success.

Any ideas?

--
Henning Sprang
http://www.sprang.de

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@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/CAB10%2BLu%3DJwCgLv46FDpE3-4Tu6b%2B7C15rf1vcEBsmFXB%2B44NCA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@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/2097542386-1401286725-cardhu_decombobulator_blackberry.rim.net-540712219-%40b1.c3.bise7.blackberry.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment