Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8728053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:33:06+00:00 2026-06-13T08:33:06+00:00

I am running a django based web application with apache. I am able to

  • 0

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
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T08:33:07+00:00Added an answer on June 13, 2026 at 8:33 am

    According to this thread on mysql.com:

    There are two things that could go wrong here:

    1. You don’t have permissions to access the directory /var/lib/mysql/whatever.sock because mysql is the owner of the folder
      or
    2. /path/whatever.sock doesn’t exist.

    First, you should know what user apache runs as: try top command to find out the user. Then, use id thatusername command to figure what group it is in.

    Then, you can read an article about debugging this kind of problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a Python-based shell script to boilerplate a Django app with virtualenv, pip,
I have a django web application running on our apache2 production server using mod_python
This is my application environment: Redhat 6.0 Apache 2.2 Django 1.3.0 Python 2.6.6 cx_Oracle
I have a Django-based web application that is required to send a confirmation email
I'm running Django through mod_wsgi and Apache (2.2.8) on Ubuntu 8.04. I've been running
I'm running Django on Linux using fcgi and Lighttpd. Every now and again (about
I'm running Django on AppEngine (python 2.7 runtime) using their Cloud SQL. I've setup
I have Django running in Apache via mod_wsgi. I believe Django is caching my
I'm running a Django app on Apache + mod_python. When I make some changes
I've built a Django web application and some Django-Piston services. Using a web interface

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.