How do I install command line MySQL client on mac?

前端 未结 14 2135
失恋的感觉
失恋的感觉 2020-12-22 15:58

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.

相关标签:
14条回答
  • 2020-12-22 16:22

    install MySQLWorkbench, then

    export PATH=$PATH:/Applications/MySQLWorkbench.app/Contents/MacOS
    
    0 讨论(0)
  • 2020-12-22 16:25

    There is now a mysql-client formula.

    brew install mysql-client

    0 讨论(0)
  • 2020-12-22 16:25

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

    0 讨论(0)
  • 2020-12-22 16:27

    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.

    0 讨论(0)
  • 2020-12-22 16:28

    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.

    0 讨论(0)
  • 2020-12-22 16:29

    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
    
    0 讨论(0)
提交回复
热议问题