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

前端 未结 3 1627
傲寒
傲寒 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:02

    It may find weird but, I tried deleting the file mysql.sock from the tmp directory and this error disappeared...

    0 讨论(0)
  • 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 :)

    0 讨论(0)
  • 2021-01-11 17:10

    I got the same response when I went to the default URI via the link from the main Mamp page, which was http://localhost/phpMyAdmin/?lang=en-iso-8859-1&language=English. I tried the previous answer's suggestions to no avail. But then, when I chopped off some of the options in the URI and instead just went to any of the following:

    • http://localhost/phpMyAdmin/?language=English
    • http://localhost/phpMyAdmin/?lang=en-iso-8859-1
    • http://localhost/phpMyAdmin

    then it worked.

    0 讨论(0)
提交回复
热议问题