title: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) Ubuntu
body: <p>I have checked status of mysql by <code>sudo service mysql status</code> and get the following output:</p>
  
  <pre><code> mysql.service - LSB: Start and stop the mysql database server daemon
     Loaded: loaded (/etc/init.d/mysql; bad; vendor preset: enabled)
     Active: active (exited) since Fri 2016-07-22 15:06:35 IST; 11s ago
       Docs: man:systemd-sysv-generator(8)
    Process: 4946 ExecStart=/etc/init.d/mysql start (code=exited, status=0/SUCCESS
  
  Jul 22 15:06:35 ubuntu-lenovo systemd[1]: Starting LSB: Start and stop the mysql
  Jul 22 15:06:35 ubuntu-lenovo systemd[1]: Started LSB: Start and stop the mysql 
  </code></pre>
  
  <p>But when I try it to run via terminal it says:</p>
  
  <blockquote>
    <p>ERROR 2002 (HY000): Can't connect to local MySQL server through socket
    '/var/lib/mysql/mysql.sock' (13)</p>
  </blockquote>
  
  <p>When I try to run with host i.e. <code>mysql --host 127.0.0.1 -uroot</code> it says:</p>
  
  <blockquote>
    <p>ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)</p>
  </blockquote>
  
  <p>I have tried almost every solution from SO.</p>