title: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
body: <p>I tried restarting the Mysql server but its not working for me. I am sure the server is running and the permissions on the folder <code>/var/lib/mysql/</code> are correct (777). </p>
  
  <p>When i tried to open the file mysql.sock, its giving me an error saying the file may be corrupt. </p>
  
  <p>Please help me log in to DB. Thanks in advance. </p>
  
  <p>This is how My.cnf looks</p>
  
  <pre><code>datadir=/var/lib/mysq
  socket=/var/lib/mysql/mysql.sock
  user=mysql
  #Disabling symbolic-links is recommended to prevent assorted security risks
  symbolic-links=0
  user            = mysql
  pid-file        = /var/run/mysqld/mysqld.pid
  socket          = /var/run/mysqld/mysqld.sock
  port            = 3306
  basedir         = /usr
  datadir         = /var/lib/mysql
  tmpdir          = /tmp
  skip-external-locking
  </code></pre>