How to Access MySQL CLI in MAMP with MAC OS X

The first thing you need to do is to start MAMP and once it is running just type the command below.

/Applications/MAMP/Library/bin/mysql -uroot -p

Then enter the password “root”, which is the default password for MAMP if you have not changed it of course. If it was successful then you should get something like this bellow

Of course, using that command can a hassle so what I usually do is create an alias command for it, like this.

sudo nano ~/.bash_profile

Then enter this code.

alias mysql=/Applications/MAMP/Library/bin/mysql

The refresh the file.

source ~/.bash_profile

Then we can just use the command like this.

mysql -uroot -proot

About the Author: Edwin DiazEdwin Diaz is an Engineer / Programmer / Web developer, Instructor and Entrepreneur.Hobbies Include... traveling , biking, rollerblading , swimming, hiking , and writing.Personal Note:I believe in the higher power and I'm doing my part in giving without expecting to receive. I love helping people and I plan to leave my mark on this earth by doing all the best I can to help every human being I encounter.

Leave a reply:

Your email address will not be published.