I want to install the MySQL client for the command line, not a GUI. I have searched over the web but only found instructions on installing the MySQL server.
This strictly installs a command line client, without the other overhead:
Install Homebrew (if you don't have it):
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Then, install mysql-client
:
brew install mysql-client
Then, add the mysql-client
binary directory to your PATH:
echo 'export PATH="/usr/local/opt/mysql-client/bin:$PATH"' >> ~/.bash_profile
Finally, reload your bash profile:
source ~/.bash_profile
Then you should be able to run mysql
in a terminal, if not try opening a new terminal
if you need a lighter solution i recommend mysql-shell, install using the command below.
brew cask install mysql-shell
To start after installation type mysqlsh.