I have problem when I try to connect to MySQL MAMP :
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (2)
I'm doing research but I have not found a solution to my problem, I try to link mysql.sock like this :
sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock
But, the file /tmp/mysql.sock doesn't exist.
Do you have any ideas ? The problem is blocking me for 2 days, I searched for this time but nothing good for me.
Thanks in advance,
Solution #2: Connect with 127.0. Another possible solution to the >can't connect to local mysql server through socket> error message is to try and connect to the MySQL using the 127.0. 0.1 ip address instead of localhost. When you use localhost to connect to MySQL, the operating system uses the socket connector.
It means either the MySQL server is not installed/running, or the file mysql. sock doesn't exist in /var/lib/mysql/ . There are a couple of solutions for this error. Then try to connect again.
In some cases /Applications/MAMP/tmp/mysql/mysql.sock.lock may create the problem. remove .lock and it will work (OSX)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With