Warning: mysql_connect(): [2002] No such file or directory (trying to connect via unix:///tmp/mysql.sock) in

后端 未结 17 2305
长发绾君心
长发绾君心 2020-11-22 08:27

I\'m trying to connect to my MySQL DB with the Terminal on my Apple (With PHP).

Yesterday it worked fine, and now I suddenly get the error in the title.

The

17条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-22 09:01

    I just had this problem, but it only appeared when loading certain pages (other pages worked fine). It turned out that I was making calls to MySQL after I closed the connection with mysql_close(). So, as @brucenan said: make sure that MySQL is running when you call it.

提交回复
热议问题