title: mysql connection refused and mysql no such file or directory
body: <p>Simply connecting to mysql server, username password and host all are correct.</p>
  
  <p>Still mysql_error() throws the following error:</p>
  
  <pre><code>Warning: mysql_connect(): No such file or directory in 
  save.php on line 6
  No such file or directory
  </code></pre>
  
  <p>When I change it from 'localhost' to '127.0.0.1', it gives error:</p>
  
  <pre><code>Warning: mysql_connect(): Connection refused in 
  save.php on line 6
  Connection refused
  </code></pre>
  
  <p>The same connection is working without any issue for a wordpress website on the same host.</p>
  
  <p>When I enter wrong password, mysql throws error of password not exist</p>
  
  <p>What does it mean ?</p>
  
  <p>[Update]</p>
  
  <p>I checked my phpinfo() and </p>
  
  <pre><code>mysql.default_socket    no value    no value
  </code></pre>
  
  <p>same for default_host, user, password etc.</p>
  
  <p>I tried</p>
  
  <pre><code>ini_set("mysql.default_socket","/var/run/mysqld/mysqld.sock");
  </code></pre>
  
  <p>as mention in php.ini but no luck.</p>
  
  <p>Again its working for a wordpress previous install and its wp_config has the same mysql access. For wrong password sometime it throws "password not exist"</p>