Run from command line:
$ /Applications/MAMP/Library/bin/mysql -u root -p
Is mySQL running?
$ ps -e | grep mysql
Does socket file exist?
$ ls -la /Applications/MAMP/tmp/mysql/mysql.sock
You can check if mysql is running with the following command:
mysqladmin -u root -p status
On OS X to start/stop/restart MySQL from the command line:
$ sudo /usr/local/mysql/support-files/mysql.server start
$ sudo /usr/local/mysql/support-files/mysql.server stop
$ sudo /usr/local/mysql/support-files/mysql.server restart