I'm trying to run the mysql command on my mac osx but keep getting the error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (2)
I did try researching this extensively but could'nt find a suitable solution. Most of the solutions refer to /etc/my.cnf but I don't seem to have this configuration file in the first place. I'm pretty much stuck and have been for quite a while. Any help is greatly appreciated.
Best Answer
In addition to ajreal's answer, check the "obvious" stuff...a lot of times you'll get this error when MySQL server isn't running, or you don't have permission to access it. Check in your process list to make sure it's running, seeing something like...
If you don't have permissions, try the command
sudo chmod 775 /var/lib/mysql
to elevate your permissions.Or if it IS running, you may need to reinstall (yikes) but if you don't have much time, and scratching it is an option, use it as a last resort.