title: django Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock
body: <p>I have made a virtual environment and installed following:</p>
  
  <pre><code>sudo apt-get install libmysqlclient-dev
  sudo pip install MySQL-python
  </code></pre>
  
  <p>and my setting is :</p>
  
  <pre><code>DATABASES = {
  'default': {
      'ENGINE': 'django.db.backends.mysql', 
      'NAME': 'DB_NAME',
      'USER': 'DB_USER',
      'PASSWORD': 'DB_PASSWORD',
      'HOST': 'localhost', 
      'PORT': '3306',
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>and when I do <code>manage.py syncdb</code> it gives the error saying <code>2002, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)")</code></p>
  
  <p>I dont know whats wrong in here... 
  I searched for it... Mostly I found if I use virtualenvironment then the above setting is enough... Whats wrong in here ???</p>