Mac OS X & MAMP - How to start mysql without entering the full path?

Right now, if I want to start mysql, I need to do / Applications / MAMP / Library / bin / mysql -u user -ppass ... I would be a happy camper if I could just do mysql -u user -ppass ... I caught googling but couldn’t find anything ... I have the feeling that I’m using stupid search queries, so if anyone knows how to do this, that would be awesome ...

+6
mysql startup macos
source share
4 answers

you can either add / Applications / MAMP / Library / bin / to your bash PATH variable (edit your .bash_profile, find the line with

  export PATH = ... 
and add the path to the bin MAMP folder here), or create an alias with
  alias mysql = '/ Applications /.../ bin / mysql' 
(also in your .bash_profile).
+7
source share

Add

export PATH=$PATH:/Applications/MAMP/Library/bin/ 

in your ~ / .profile

It takes effect the next time your profile is initialized (I'm not sure when it is under OS X, maybe when you launch your terminal application it may be at login)

+4
source share

It depends on which shell you use. You should be able to add / Applications / MAMP / Library / bin / to your path:

 export PATH=${PATH}:/Applications/MAMP/Library/bin 

Mac OS uses bash by default. Just add this line to your .bashrc.

+3
source share

Follow up . ./.profile . ./.profile to restart your profile.

+2
source share

All Articles