title: function Mysql-connect Error
body: <p>I have a problem on connection.php file, the file runs fine when on localhost, but when upload to hosting an error like this:</p>
  
  <pre><code>Warning: mysql_connect () [function.mysql-connect]: Can not connect to local MySQL server through socket '/ var / lib / mysql / mysql.sock' (2) in / home/content/84/10207284/html / koneksi.php on line 6
  </code></pre>
  
  <p>My script like this:</p>
  
  <pre><code>&lt;? php
      $server = "localhost";
      $username = "*******";
      $password = "******";
      $database = "*****";
      mysql_connect ("$server", "$username", "$password") or die ("Failed");/ /  the error Line
      mysql_select_db ("holidayhappy") or die ("Database not found");
  ?&gt;
  </code></pre>
  
  <p>I have tried to change localhost with Server IP ann port, but it is not working too.</p>
  
  <p>Can Someone Help me to Fix this Problem...?</p>