Command Line Client On Mac For Mysql

  1. How To Install Softether Vpn Client On Mac
  2. Mysql Command Line Remote Server

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.

Active4 months ago

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
2,8276 gold badges27 silver badges54 bronze badges
hchhch
1,4545 gold badges14 silver badges21 bronze badges

13 Answers

user1659189user1659189
1,5091 gold badge9 silver badges4 bronze badges
Mysql

If you have already installed MySQL from the disk image (dmg) from http://dev.mysql.com/downloads/), open a terminal, run:

then, reload .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
2,8276 gold badges27 silver badges54 bronze badges
JackSparrowJackSparrow
Michael Lihs
2,8276 gold badges27 silver badges54 bronze badges
GeekGeek

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.

trosemantroseman

There is now a mysql-client formula.

brew install mysql-client

egzeegze

Open the 'MySQL Workbench' DMG file and

Command

Eject the DMG disk

caccialdocaccialdo

There is a Homebrew formulae for just a client: https://formulae.brew.sh/formula/mysql-client

Install it by: brew install mysql-client

IvanIvan
4,2894 gold badges37 silver badges55 bronze badges

For installing mysql-shell with homebrew, run

you can then launch the mysql shell with

if you want to enter SQL mode directly, run

Michael LihsMichael Lihs
2,8276 gold badges27 silver badges54 bronze badges

This strictly installs a command line client, without the other overhead:

Install Homebrew (if you don't have it):

Then, install mysql-client:

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

Alex WAlex W
29k7 gold badges72 silver badges86 bronze badges

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 .bash_profile:

This will let you run mysql from anywhere as you.

How To Install Softether Vpn Client On Mac

Michael Lihs
2,8276 gold badges27 silver badges54 bronze badges
Paul KenjoraPaul Kenjora

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)'

Kimmo HintikkaKimmo Hintikka
2,1113 gold badges22 silver badges39 bronze badges

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.

WillaWilla

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. mysql57-server)

Alex GAlex G

protected by Bhargav RaoMay 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?

Mysql Command Line Remote Server

Not the answer you're looking for? Browse other questions tagged mysqlmacosterminal or ask your own question.