title: mysql.sock file missing from MAMP
body: <p>I am using:</p>
  
  <ul>
  <li>MAMP 3.0.7.3</li>
  <li>OSX 10.10.2</li>
  <li>laravel/homestead (vagrant) to host my site locally</li>
  </ul>
  
  <p>Specifically, the error I get is:</p>
  
  <blockquote>
    <p>PDOException in Connector.php line 47:
    SQLSTATE[HY000] [2002] No such file or directory</p>
  </blockquote>
  
  <p>In my Laravel project, in config/database.php, I have:</p>
  
  <pre><code>'mysql' =&gt; [
              'driver'    =&gt; 'mysql',
              'host'      =&gt; env('DB_HOST', 'localhost'),
              'unix_socket' =&gt; '/Applications/MAMP/tmp/mysql/mysql.sock',
              'database'  =&gt; env('DB_DATABASE', 'stocks'),
              'username'  =&gt; env('DB_USERNAME', 'stock_admin'),
              'password'  =&gt; env('DB_PASSWORD', 'password'),
              'charset'   =&gt; 'utf8',
              'collation' =&gt; 'utf8_unicode_ci',
              'prefix'    =&gt; '',
              'strict'    =&gt; false,
          ],
  </code></pre>
  
  <p>In my .env file:</p>
  
  <pre><code>APP_ENV=local
  APP_DEBUG=true
  APP_KEY=KGY7geRpdCKywyqFhlBFvfNX1g5wXal0
  
  DB_HOST=127.0.0.1
  DB_DATABASE=stocks
  DB_USERNAME=stock_admin
  DB_PASSWORD=password
  
  CACHE_DRIVER=file
  SESSION_DRIVER=file
  QUEUE_DRIVER=sync
  
  MAIL_DRIVER=smtp
  MAIL_HOST=mailtrap.io
  MAIL_PORT=2525
  MAIL_USERNAME=null
  MAIL_PASSWORD=null
  </code></pre>
  
  <p>I have tried changing DB_HOST between localhost and 127.0.0.1 to no avail.</p>
  
  <p>I have installed mysql through brew. 
  The actual file /Applications/MAMP/tmp/mysql/mysql.sock does not exist when I look for it in the finder.</p>
  
  <p>I have checked my /Applications/MAMP/bin files:</p>
  
  <p>startmysql.sh</p>
  
  <pre><code>#!/bin/sh
  
  /Applications/MAMP/Library/bin/mysqld_safe --port=3306 --socket=/Applications/MAMP/tmp/mysql/mysql.sock --pid-file=/Applications/MAMP/tmp/mysql/mysql.pid --log-error=/Applications/MAMP/logs/mysql_error_log &amp;
  </code></pre>
  
  <p>and stopMysql.sh:</p>
  
  <pre><code>#!/bin/sh
  
  /Applications/MAMP/Library/bin/mysqladmin -u root -proot --socket=/Applications/MAMP/tmp/mysql/mysql.sock shutdown
  </code></pre>
  
  <p>I have also tried creating a symbolic link with these commands:</p>
  
  <pre><code>sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock
  </code></pre>
  
  <p>and</p>
  
  <pre><code>sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/tmp/mysql.sock
  </code></pre>
  
  <p>and it does not appear to work.</p>
  
  <p>I understand the mysql.sock file is created dynamically, but it does not appear to happen in my case. I am unsure how to proceed from here; it feels as though I have tried everything. Any help is appreciated.</p>