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

Leave a reply:

Your email address will not be published.

Site Footer