I am running a django based web application with apache. I am able to connecto to mysql from python and linux shell but, when i run the server i am getting the following error. Where am i doing wrong?
OperationalError at /
(2002, "Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)")
Request Method: GET
Request URL: http://dev.ls.co.uk/
Django Version: 1.3
Exception Type: OperationalError
Exception Value:
(2002, "Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)")
Exception Location: build/bdist.linux-x86_64/egg/MySQLdb/connections.py in __init__, line 187
Python Executable: /usr/bin/python
Python Version: 2.4.3
According to this thread on mysql.com:
First, you should know what user apache runs as: try
topcommand to find out the user. Then, useid thatusernamecommand to figure what group it is in.Then, you can read an article about debugging this kind of problem.