Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mac OS X & MAMP - How to run mysql without having to type in the full path?

Right now, if I want to run mysql, I have to do /Applications/MAMP/Library/bin/mysql -u user -ppass... I'd be a happy camper if I could just do mysql -u user -ppass.... Been googling around, but haven't been able to find anything... Have a feeling I'm using dumb search terms, so if anyone here knows how to do this, that'd be awesome...

like image 581
BigDogsBarking Avatar asked Apr 21 '10 15:04

BigDogsBarking


People also ask

What does Mac OS X stand for?

OS X is version 10 of the Apple MacIntosh operating system . OS X was described by Apple as its first "complete revision" of the OS since the previous version is OS 9, with a focus on modularity so that future changes would be easier to incorporate.

Is Mac OS X still supported?

Apple only officially supports the three most recent versions of macOS (currently 10.15 Catalina, 11 Big Sur, and 12 Monterey). If you're running an older version of macOS, it is no longer receiving security or stability updates.

What year is Mac OS X?

On March 24, 2001, Apple released the first version of its Mac OS X operating system, noteworthy for its UNIX architecture. OS X (now macOS) has been known over the years for its simplicity, aesthetic interface, advanced technologies, applications, security and accessibility options.

What is the latest version of Mac OS X?

The current major version, macOS 12 Monterey, was announced on June 7, 2021 at WWDC 2021 and released on October 25 of that year; the latest version of macOS 12, macOS 12.6, was released on September 12, 2022.


2 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 here the path to MAMP bin folder) , or maybe create an alias with
alias mysql='/Applications/.../bin/mysql'
(also in your .bash_profile).
like image 97
matei Avatar answered Sep 28 '22 20:09

matei


Add:

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

to your ~/.profile

It will take effect next time your profile is initialized (I'm not sure when that is under OS X, it might be when you start your terminal application, it might be when you log in)

like image 22
Quentin Avatar answered Sep 28 '22 20:09

Quentin