Accessing MAMP MySQL terminal

For accessing the MAMP MySQL via the terminal in OS X, entering the mysql command may result in this error:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

To solve this, simply provide the path to the correct .sock file

$ mysql --socket=/Applications/MAMP/tmp/mysql/mysql.sock --user=username --password=password

More info:
Solve: Can’t connect to local MySQL server through socket /tmp/mysql.sock [Tech-Recipes]

Leave a Reply

Your email address will not be published. Required fields are marked *