I am having a hard time understanding why PHP cannot connect with localhost
as a host. I can connect by doing:
mysql -uroot -p
And also, through Sequel Pro I can connect with localhost as a host. But with PHP, I get:
Warning: mysqli_connect(): (HY000/2002): No such file or directory
I am sure it's because of the sockets, because If I try to change to 127.0.0.1 it works.
Why doesn't host work?