When you have installed MAMP (Mac Apache, MySQL, PHP) on your Mac, you may want to connect to it’s MySQL Server using the OS X Terminal.app
To do so, execute the following command in a Terminal window:
/Applications/MAMP/Library/bin/mysql -uroot -proot -P 8889
When the authentication was successful, the message “Welcome to the MySQL monitor” will be displayed in the Terminal window.