ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)
This is a fix for Mac Os X
Nguồn: https://kythuatmarketingonline.com/
Xem thêm bài viết: https://kythuatmarketingonline.com/category/cong-nghe

VIKRAMs-MacBook-Pro:~ vikramsingh$ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
VIKRAMs-MacBook-Pro:~ vikramsingh$ sudo mkdir /var/mysql
VIKRAMs-MacBook-Pro:~ vikramsingh$ sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock
ln: /var/mysql/mysql.sock: File exists
VIKRAMs-MacBook-Pro:~ vikramsingh$ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
VIKRAMs-MacBook-Pro:~ vikramsingh$
I executed your commands, still the same error, here you can see.. I executed same commands again so it says file exist but when i run mysql it gives error.
Please if you can help immediately
omg, it’s 4:30 AM and I found after 4 hours searching… You saved my time 😡
Thank you friend
it didn't work
it says sudo in command not found
Sounds like Skoglund
Thank you. It works!
Still working. <3
Thank you!!!!
What about xp its for linux can u post steps to solve this proble in windows 7
Thank you!! You're a lifesaver 🙂
solved my problem! forgot to type thanks you!
solved my problem!
sudo: mysql_safe: command not foundttys000
what i can do
yess! thank you sir!
uhm?
For Mac users, I suggest you use MAMP and install that instead. I had it up and running and it's brilliant for running your own testing server on your own Mac. MAMP runs MySQL, Apache and PHP all in one go. Just download the regular version. You won't need the Pro version.
For Mac users, I suggest you use MAMP and install that instead. I had it up and running and it's brilliant for running your own testing server on your own Mac. MAMP runs MySQL, Apache and PHP all in one go. Just download the regular version. You won't need the Pro version.
Please feel welcome to add helpful information about the MySQL 2002 connection issues for Mac & Windows. I ran into an issue between the MAMP server and my Dreamweaver CS4 failing to connect with my MySQL databases. Let me know if you need the settings I used that eventually solved the problem and finally connected my Dreamweaver CS4 to the MySQL running on my local server.