MAMP - phpMyAdmin #2002 - Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock'

前端 未结 3 1629
傲寒
傲寒 2021-01-11 16:36

I was working on MAMP phpMyAdmin and everything worked well until i query an ALTER TABLE statement from SQL tab. Operation was too long to end so i decided to r

3条回答
  •  执念已碎
    2021-01-11 17:08

    I am seeing exactly the same. MAMP MySQL running, and this messgage from PHPMyAdmin

    MySQL said:

    #2002 - Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
    

    The server is not responding (or the local server's socket is not correctly configured).

    I did use : sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock to allow local PHP CLI access to MAMP MySQL

    I found the config file for phpMyAdmin here: /Applications/MAMP/bin/phpMyAdmin/config.inc.php

    I added this explicit path in the config file.

    $cfg['Servers'][$i]['socket'] = '/Applications/MAMP/tmp/mysql/mysql.sock';
    

    Now it works :)

提交回复
热议问题