If you are on OSX and have XAMPP,then please follow these steps:
Thanks to Jackstine's answer, I was able to do the following:
$ cat ~/.my.cnf
[mysql]
# CLIENT #
port = 3306
socket = /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock
I hope this helps me again when I forget, in the future!