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
    原文作者:启程
    原文地址: https://segmentfault.com/a/1190000002397050
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞