Can't start phpMyAdmin. Keep getting the #2002 socket error

前端 未结 9 1885
难免孤独
难免孤独 2020-12-31 05:44

I\'ve been trying to set mysql and phpMyAdmin for the last 12 hours, without any success. And yes, after hours and hours of Google-ing I know that is a common problem and I\

9条回答
  •  时光取名叫无心
    2020-12-31 05:54

    Am using MAMP on a macbook pro running High Sierra, and in my case, I tried all the above but it still did not work for me so I did the following :

    1. Looking for where you installed your MAMP and more specifically, look for the "config.inc.php" file located in "/Applications/MAMP/bin/phpMyAdmin".

    1. Backup (ie. on a mac, right click and duplicate) the "config.inc.php" file before we touch it. You can call or rename it "config_old.inc.php"

    2. Open the file in your favorite IDE or text editor.

    1. Look for the following lines ;

    i) $cfg['Servers'][$i]['host']

    ii) $cfg['Servers'][$i]['port']

    iii) $cfg['Servers'][$i]['socket']

    Change from :

    $cfg['Servers'][$i]['host'] = 'localhost';
    

    to :

    $cfg['Servers'][$i]['host'] = '127.0.0.1';
    

    Change from :

    $cfg['Servers'][$i]['port'] = '3306';
    

    /this might be your default. Just check to see from your MAMP installation preference , press CMD + , and confirm that port number you have specified. In my case I had changed it to 8889./

    to :

    $cfg['Servers'][$i]['port'] = '8889';
    

    Again depending on where you installed your MAMP or to be more specific your mysql.

    Change from :

    $cfg['Servers'][$i]['socket'] = 'some_folder_path or EMPTY';
    

    to :

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

    After this modification, save and refresh in your web browser.

    Worked for me. Hope this helps. Cheers.

提交回复
热议问题