How do I install command line MySQL client on mac?

前端 未结 14 2134
失恋的感觉
失恋的感觉 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:30

    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

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

    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.

    0 讨论(0)
提交回复
热议问题