title: PDOException: SQLSTATE[HY000] [2002] No such file or directory
body: <p>I have put PushChatServer dir in htdocs folder and create database puschat try to run @"<a href="http://localhost/PushChatServer/api/test/database.php" rel="noreferrer">http://localhost/PushChatServer/api/test/database.php</a>"</p>
  
  <p>Then I got following exception.</p>
  
  <p>I want do same thing to explain this link <a href="http://www.raywenderlich.com/32963/apple-push-notification-services-in-ios-6-tutorial-part-2" rel="noreferrer">http://www.raywenderlich.com/32963/apple-push-notification-services-in-ios-6-tutorial-part-2</a></p>
  
  <p>I have done all that but I got this exception</p>
  
  <blockquote>
    <p>Could not connect to the database. Reason: exception 'PDOException' with message 'SQLSTATE[HY000] [2002] No such file or directory' in /Applications/MAMP/htdocs/PushChatServer/api/test/database.php:17 Stack trace: #0 /Applications/MAMP/htdocs/PushChatServer/api/test/database.php(17): PDO->__construct('mysql:host=loca...', 'root', 'root', Array) #1 {main}</p>
  </blockquote>