Can't connect to MySQL on Mac — missing mysql.sock file

前端 未结 7 1041
醉话见心
醉话见心 2020-12-16 04:10

I installed MySQL on my Mac OS 10.6 about a week ago, and, after some playing around, got it to work just fine. It integrated with python MySQLdb and I also got Sequel Pro

7条回答
  •  借酒劲吻你
    2020-12-16 04:43

    First of all I suggest you to use homebrew to install any third part libraries or tools on your mac. Have a look to : http://mxcl.github.com/homebrew/

    Otherwise for your problem you can search where is the mysql socket on your mac and then symlink it to /tmp.

    In your terminal try something like :

    locate mysql | grep sock
    

    You will get something like :

    /the/path/to/mysql.sock
    

    Then do :

    ln -s /the/path/to/mysql.sock /tmp/mysql.sock
    

    This should works.

    Also you can edit your php.ini file to set the correct path for the mysql socket.

    Hope this help.

提交回复
热议问题