Access MAMP's MySQL from Terminal

Don P picture Don P · Feb 17, 2012 · Viewed 59k times · Source

I want to practice using SQL instead of phpMyAdmin.

How do I log into MAMP's MySQL from the terminal?

Answer

Ray picture Ray · Feb 17, 2012

I'm assuming the version of MAMP you're using installs itself in /Applications/MAMP. First make sure via the MAMP console that the Mysql server is on. Then connect like this from command line:

/Applications/MAMP/Library/bin/mysql -uUsername -pPassword

Obviously replace Username and Password. BTW, there is no space between -u and the Username or -p and the Password.

Good Luck learning Mysql the old fashion way!