mac with SQLSTATE[HY000] [2002] No such file or directory

  1. Open up php.ini (mine was in /private/etc/)
  2. locate this line: pdo_mysql.default_socket=/var/mysql/mysql.sock
  3. Change the line to: pdo_mysql.default_socket=/tmp/mysql.sock
  4. Restart apache

评论

暂无评论