Access MAMP’s mysql from command
If you just want to type:
1 | mysql -u Username -p |
You can create an alias in your ~/.bash_profile in older OSX versions this file was called ~/.profile so best check first with:
1 | ls -la ~/ |
If one of those files exist, edit that file. Else, create a new one with what ever editor you like (here I do it with nano and have a ~/.bash_profile file):
1 | sudo nano ~/.bash_profile |
insert following line:
1 | alias mysql=/Applications/MAMP/Library/bin/mysql |
Save the file and quit nano with CTRL + X and then type Y and enter
Then you need to type:
1 | source ~/.bash_profile |
Now you can use:
1 | mysql -u root -p |