I downloaded the latest version from phpMyAdmin's official website, unzipped it to/library/webserver/documents, and renamed the folder phpMyAdmin.
Then enter localhost/phpmyadmin/in the browser, fill in the user name password but prompt [2002] No such file or directory.
On the internet to find a lap, it seems that the location of the mysql.sock is wrong.
First, open the terminal and find the location of Mysql.sock.
sudo Find /-name Mysql.sock
The results are as follows:
Find:/DEV/FD/3: Not a directoryfind:/dev/fd/4: Not a Directory/private/tmp/mysql.sock
Then check whether the directory/var/mysql/exists
ls -la/var/mysql
The results in my computer are as follows:
LS:/var/mysql:no such file or directory
Because it does not exist, create a new directory:
sudo mkdir /var/mysql
Next, create a symbolic link for mysql.sock, and map to the new directory.
sudo LN -s/private/tmp/mysql.sock/var/mysql/mysql.sock
I re-opened the localhost/phpmyadmin/in the browser, I can log in successfully.
[Mac] [PhpMyAdmin] [2002] No such file or directory