title: Can't connect to MySQL on Mac -- missing mysql.sock file
body: <p>I installed MySQL on my Mac OS 10.6 about a week ago, and, after some playing around, got it to work just fine.  It integrated with python MySQLdb and I also got Sequel Pro to connect to the database.  However, php wouldn't access the server.  Even after I added a php.ini file to /etc/ and directed it toward the same sock that Sequel Pro was using: /tmp/mysql.sock.  </p>
  
  <p>But now I can't access the local server at all.  As far as I can tell, there is no mysql.sock file anywhere on my computer, not in /tmp/ or anywhere else.</p>
  
  <p>I can start the mysql server from Terminal, but it logs me out automatically after a minute:</p>
  
  <pre><code>110425 17:36:18 mysqld_safe Logging to '/usr/local/mysql/data/dn0a208bf7.sunet.err'.
  110425 17:36:18 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
  110425 17:37:58 mysqld_safe mysqld from pid file /usr/local/mysql/data/dn0a208bf7.sunet.pid ended
  </code></pre>
  
  <p>If I try to call "mysql" from the command line (which worked perfectly earlier today):</p>
  
  <pre><code>ERROR 2002 (HY000): Can\'t connect to local MySQL server through socket '/tmp/mysql.sock' (2)
  </code></pre>
  
  <p>The PHP error is of course similar:</p>
  
  <pre><code>PHP Warning:  mysql_real_escape_string(): [2002] No such file or directory (trying to connect via unix:///tmp/mysql.sock)
  </code></pre>
  
  <p>Also, there is no "my.cnf" file in my mysql installation directory: /usr/local/mysql.  There are my.cnf files for the mysql installations that come along with XAMPP.  Those also have the default socket listed as '/tmp/mysql.sock', but I had to change them manually.</p>
  
  <p>Any ideas what's going on?  Why would modifying the php.ini file have produced a change for Sequel Pro as well?</p>