I am new to OS X and was following a video and typed
export PATH="$HOME/opt/git/bin:$PATH"
I believe this messed up my path and I am not able to install MySQL now.
When I tried to install Homebrew I get
-bash: homebrew: command not found.
I tried restarting the terminal. How can I correct this?
Best Answer
Where did you get the
export
line from?First things first: Look into your home folder (e.g. open a Finder window). Is there really a folder called
opt
in there? If yes, something's really messed up. If no, yourexport
command was just wrong, since there's noopt
under$HOME
(which is your user's home folder)./opt
is typically at the root level of the file system.Is there a folder called
/opt
? Open a Terminal and enterls /opt
. Does this directory exist? If yes, then you're probably using another package manager already and should not install Homebrew.But even then, if
/opt
really exists, there shouldn't be/opt/git/bin
.If you really want to install a new version of Git, you can do that with:
/usr/local/git/
brew install git
, see below, which will install thegit
command to/usr/local/bin/
To install Homebrew, you have to follow the instructions. There is no
homebrew
command. You also don't have to change yourPATH
.You just have to copy and paste this to your Terminal:
This will install Homebrew, but make it available under the
brew
command. So to install MySQL through Homebrew, you'd enter: