I would use the nano
editor to edit the correct file for your shell, which is zsh, not bash.
nano ~/.zshrc
Put this line in at the top of the file
typeset -U path PATH
Put this line towards the bottom and save:
path+=/usr/local/mysql/bin
Press the control key and the X key to exit (see the bottom of the nano window for more commands). If you then quit your terminal app, you can test for mysql
being in your path.
You can tell your shell with echo $SHELL
and if you want bash since all your instructions are in it, you can go back to that if needed with chsh /bin/bash
in which case you would nano the file ~/.bash_profile since each shell reads different start up files. I recommend learning zsh
and finding guides that work there, though.
ls -al ~/.bash_profile
and copy/paste both the command and the result as text into the question text.zsh
so why do you want to update.bash_profile
?.bash_profile
to.zshenv
in the command>>
will create the file if it doesn't exist, so using>
instead is not necessary. And using>
is dangerous, because if the file does exist, it'll be silently and irretrievably erased before the new content is added.