title: MAMP - phpMyAdmin #2002 - Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock'
body: <p>I was working on MAMP phpMyAdmin and everything worked well until i query an <code>ALTER TABLE</code> statement from SQL tab. Operation was too long to end so i decided to refresh my page. From this time, i cannot reach phpMyAdmin anymore and i always have this message :</p>
  
  <pre><code>#2002 - Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (2)
  </code></pre>
  
  <p>I've tried a lot of things found on the net, including on Stackoverflow, Server Fault, ... like reinstalling MAMP, symlink to <code>/tmp/mysql.sock</code>, modify <code>config.inc.php</code>, etc, but nothing worked.</p>
  
  <p>Everything's good when i run <code>mysql</code> from command line :</p>
  
  <pre><code>$ /Applications/MAMP/Library/bin/mysql -u root -p
  Welcome to the MySQL monitor.  Commands end with ; or \g.
  Your MySQL connection id is 3
  Server version: 5.5.29 Source distribution
  
  mysql&gt; SHOW SCHEMAS;
  +--------------------+
  | Database           |
  +--------------------+
  | information_schema |
  | mysql              |
  | performance_schema |
  +--------------------+
  3 rows in set (0,65 sec)
  </code></pre>
  
  <p><code>mysqld</code> is properly running :</p>
  
  <pre><code>$ ps -e | grep mysql
   7007 ??         0:00.03 /bin/sh /Applications/MAMP/Library/bin/mysqld_safe --port=8889 --socket=/Applications/MAMP/tmp/mysql/mysql.sock --lower_case_table_names=0 --pid-file=/Applications/MAMP/tmp/mysql/mysql.pid --log-error=/Applications/MAMP/logs/mysql_error_log
   7141 ??         0:00.37 /Applications/MAMP/Library/bin/mysqld --basedir=/Applications/MAMP/Library --datadir=/Applications/MAMP/db/mysql --plugin-dir=/Applications/MAMP/Library/lib/plugin --lower-case-table-names=0 --log-error=/Applications/MAMP/logs/mysql_error_log.err --pid-file=/Applications/MAMP/tmp/mysql/mysql.pid --socket=/Applications/MAMP/tmp/mysql/mysql.sock --port=8889
  </code></pre>
  
  <p>And socket file exist :</p>
  
  <pre><code>$ ls -la /Applications/MAMP/tmp/mysql/mysql.sock 
  srwxrwxrwx  1 user  admin  0 21 avr 16:57 /Applications/MAMP/tmp/mysql/mysql.sock
  </code></pre>
  
  <p>Someone had already faced this kind of issue ? </p>