Trying to use MySQL for rails app and downloaded it from dev.mysql.com.
After successfully installing the package and seeing the option to start and stop the server from
You should try paste this line to your environment variables
export PATH=${PATH}:/usr/local/mysql/bin/
Then try restart your environment variables with the following command
source ~/.zshrc #If you use Oh-My-Zsh
source ~/.bashrc #If you use Default Bash
On the latest MacOs Catalina.I hava tried to do above to sole this problem;
vi ~/.zshrc // open the zsh config and edite
export PATH=${PATH}:/usr/local/mysql/bin/ // to add these words
source ~/.zshrc // make it work
Reopen a teminal and run mysql -u root -p
,input the password then you can login your mysql;
For my MacOS Catalina. I tried everything above, it didn't work. The code below worked for me. Thanks to this link https://www.youtube.com/watch?v=kijzRVw8eUQ. Input the code in your terminal.
/usr/local/mysql/bin/mysql -uroot -p
This was supposed to be a problem within my configuration and $PATH
variable. I followed mysql on mactutorial to resolve this.
In my terminal opened up configuration by going to vi ~/.zshrc
. Located line for export PATH="..."
and appended :/usr/local/mysql/bin
to it.
Above procedure resolved my issue.
On MacOs Catalina Open a terminal and run.
sudo nano /etc/paths
Added to end of file
/usr/local/mysql/bin
Save the changes and quit. Reloaded terminal. Open a new terminal and run.
mysql -u root -p
Its works for me.!!