title: CakePHP: No such file or directory (trying to connect via unix:///var/mysql/mysql.sock)
body: <p>I have had a cakephp app running fine on my local machine (mac osx) for a while and then suddently I realise that I can't connect to mysql.sock. </p>
  
  <p>I'm getting this error:</p>
  
  <pre><code>Warning (2): mysql_connect() [http://php.net/function.mysql-connect]: [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) [CORE/cake/libs/model/datasources/dbo/dbo_mysql.php, line 540]
  </code></pre>
  
  <p>The line 540 of dbo_mysql.php reads:</p>
  
  <pre><code>$this-&gt;connection = mysql_connect($config['host'] . ':' . $config['port'], $config['login'], $config['password'], true);
  </code></pre>
  
  <p>I've checked, there is no fle //var/mysql/mysql.sock. It's actually in /tmp/mysql.sock</p>
  
  <p>I tried changing my php.ini.default to match the above but it's already set to look in /tmp/ for local connections. Why, and where is the error coming from? </p>
  
  <p>Has anyone come across a similar error?</p>
  
  <p>Thanks,</p>
  
  <p>Jonesy</p>