mysqli_real_connect(): (HY000/2002): No such file or directory

luigi picture luigi · Jan 26, 2017 · Viewed 196.9k times · Source
mysqli_real_connect(): (HY000/2002): No such file or directory

PhpMyAdmin error on MacOS. I want answer I really have no idea what I need to do to resolve this.

Answer

naiz0 picture naiz0 · Feb 2, 2017

change localhost to 127.0.0.1 in /etc/phpmyadmin/config.inc.php

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

The reason for this is that pma tries to connect to the mysql.socket if you use localhost. If you use 127.0.0.1 PMA makes a TCP connection which should work.