I\'m trying to connect to my MySQL DB with the Terminal on my Apple (With PHP).
Yesterday it worked fine, and now I suddenly get the error in the title.
The
I was having the same problem and this is how I fixed it:
I had this and it didn't work:
$con = mysql_connect('localhost', 'root', '1234');
I did this and it worked:
$con = mysql_connect(':/Applications/MAMP/tmp/mysql/mysql.sock', 'root', '1234');
Instead of using the mysql server, I connected directly to the Unix Socket. Worked for me.