How do I install command line MySQL client on mac?

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

    Installation command from brew:

    $ brew cask install mysql-shell
    

    Look at what you can do:

    $ mysqlsh --help
    

    Run query from mysqlsh client installed:

    $ mysqlsh --host=192.x.x.x --port=3306 --user=user --password=xxxxx
    
    MySQL Shell 8.0.18
    
    Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
    Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
    Other names may be trademarks of their respective owners.
    
    Type '\help' or '\?' for help; '\quit' to exit.
    WARNING: Using a password on the command line interface can be insecure.
    Creating a session to 'user@192.x.x.x:3306'
    Fetching schema names for autocompletion... Press ^C to stop.
    Your MySQL connection id is 16
    Server version: 8.0.18 MySQL Community Server - GPL
    No default schema selected; 
    type \use  to set one.
    
     MySQL  192.x.x.x:3306 ssl  JS >
    
     MySQL  192.x.x.x:3306 ssl  JS > `\use rafdb`
    
    Default schema set to `rafdb`.
    

提交回复
热议问题