phpmyadmin - error 2002 - on Mac

与世无争的帅哥 提交于 2020-01-12 14:33:38

问题


I'm currently using Mac, and the running OS version is El Capitan. The web root is /Users/username/Sites.

I downloaded, extracted the phpmyadmin and moved the directory to the root folder, and I managed to get to the log in screen. But when I try to log in, it shows a message like this.

#2002 - No such file or directory<br />The server is not responding (or the local server's socket is not correctly configured).

I checked out if MySQL was turned off, but it was on so it doesn't have to do with that. Does anybody know how to solve out this matter?


回答1:


So the solution was fairly simple for my case.

After reading some articles like this, I viewed my phpmyadmin directory to find the config.inc.php file. This is what I still haven't figured out but there was no file with the same name.

Instead, the file with the closest name was config.sample.inc.php, so I changed its file name and changed $cfg['Servers'][$i]['host'] = 'localhost'; to $cfg['Servers'][$i]['host'] = '127.0.0.1';. Now I can log in with the phpmyadmin account.




回答2:


Got the same error after upgrading mariadb through homebrew upgrade on OS X Siera 10.12.5.

Turns out that a config directory was missing:

mysql: Can't read dir of '/usr/local/etc/my.cnf.d' (Errcode: 2 "No such file or directory")

Simply creating this directory solves the issue (no need to restart the mariadb daemon):

mkdir /usr/local/etc/my.cnf.d

Wait a few seconds and retry to connect:

$ mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 10.2.6-MariaDB Homebrew



回答3:


This worked for me.

  1. brew services mysql stop
  2. Go to Xampp and restart mysql service.


来源:https://stackoverflow.com/questions/34883275/phpmyadmin-error-2002-on-mac

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!