I may have shown this before in other ways, but I wanted to take a moment to show how to use a MySQL database from the MySQL command line client. The basic command to work with an existing database is the use command, where you say something like this. 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. The current development release of mysql, 4.1.1, mostly works well in osx (Panther) but the command-line client seems to have some flakiness. About the mysql command-line client. Mysql is a simple SQL shell (with GNU readline capabilities). It supports interactive and non-interactive use. When used interactively, query results are presented in an ASCII-table format. What is the best MySQL client for Mac OS X or Windows? Update Cancel. Any client for MySQL should work equally well for derived products, such as MySQL Enterprise, Percona Server, MariaDB, etc. Most MySQL database administrators use the command-line tools. I do consulting and training for MySQL, and I've visited dozens of different.
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.Michael Lihs
If you have already installed MySQL from the disk image (dmg) from http://dev.mysql.com/downloads/), open a terminal, run:
.bash_profile by running following command:
You can now use
mysql to connect to any mysql server:
Credit & Reference: http://www.gigoblog.com/2011/03/13/add-mysql-to-terminal-shell-in-mac-os-x/Michael Lihs
Mysql has a client-only set of utilities:
Mysql client shellhttps://dev.mysql.com/downloads/shell/
Other command line utilitieshttps://dev.mysql.com/downloads/utilities/
Mac OSX version available.
There is now a
brew install mysql-client
Open the 'MySQL Workbench' DMG file and
Eject the DMG disk
There is a Homebrew formulae for just a client: https://formulae.brew.sh/formula/mysql-client
Install it by:
brew install mysql-client
mysql-shell with homebrew, run
you can then launch the mysql shell with
if you want to enter SQL mode directly, runMichael LihsMichael Lihs
This strictly installs a command line client, without the other overhead:
Install Homebrew (if you don't have it):
Then, add the
mysql-client binary directory to your PATH:
Finally, reload your bash profile:
Then you should be able to run
mysql in a terminal, if not try opening a new terminal
If you installed from the DMG on a mac, it created a mysql client but did not put it in your user path.
Add this to your
This will let you run
mysql from anywhere as you.
How To Install Softether Vpn Client On MacMichael Lihs
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
Kimmo HintikkaKimmo Hintikka
/usr/bin/ruby -e '$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)'
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.
Using MacPorts you can install the client with:
You also need to select the installed version as your mysql
The server is only installed if you append
-server to the package name (e.g.
protected by Bhargav Rao♦May 24 '17 at 7:51
Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?