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.
install MySQLWorkbench, then
export PATH=$PATH:/Applications/MySQLWorkbench.app/Contents/MacOS
There is now a mysql-client
formula.
brew install mysql-client
As stated by the earlier answer you can get both mysql server and client libs by running
brew install mysql
.
There is also client only installation. To install only client libraries run
brew install mysql-connector-c
In order to run these commands, you need homebrew package manager in your mac. You can install it by running
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Mysql has a client-only set of utilities:
Mysql client shell https://dev.mysql.com/downloads/shell/
Other command line utilities https://dev.mysql.com/downloads/utilities/
Mac OSX version available.
The easiest way would be to install mysql server or workbench, copy the mysql client somewhere, update your path settings and then delete whatever you installed to get the executable in the first place.
For installing mysql-shell
with homebrew, run
brew cask install mysql-shell
you can then launch the mysql shell with
mysqlsh
if you want to enter SQL mode directly, run
mysqlsh --sql