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

前端 未结 7 1034
醉话见心
醉话见心 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:41

    Found the solution:
    I had the same issue and I did a lot of searches but couldn't solve the issue until I looked at my MySql config file. In my config file socket was in line 21 and the path was
    "/Applications/AMPPS/var/mysql.sock"

    In Ampps application click on MySql tab and then click on configuration button.

    You can also find the config file in "/Applications/AMPPS/mysql/etc" folder

    So simply I added
    'unix_socket' => '/Applications/AMPPS/var/mysql.sock',
    to my database.php in mysql array and it's worked for me.
    After host line. I have tested with localhost and 127.0.0.1 and both worked
    Hopefully it's working for you too.

提交回复
热议问题