title: Warning: mysql_connect(): [2002] No such file or directory (trying to connect via unix:///tmp/mysql.sock) in
body: <p>I'm trying to connect to my MySQL DB with the Terminal on my Apple (With PHP).</p>
  
  <p>Yesterday it worked fine, and now I suddenly get the error in the title.</p>
  
  <p>The script works when I use my browser to run it (I have XAMPP installed), but Terminal refuses to connect to the DB.</p>
  
  <p>Here is the file that I include to connect (the script works when I don't include this, but then it doesn't connect to the DB):</p>
  
  <pre><code>&lt;?php
      mysql_connect("localhost", "root", "") or die(mysql_error());
      mysql_select_db("FNB1C_data") or die(mysql_error());
  ?&gt;
  </code></pre>
  
  <p>That should work, since it works with my browser. </p>
  
  <p>The command I use at the Terminal is <code>php scriptname.php</code>.</p>