欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

mysql命令行爱好者必备工具mycli

程序员文章站 2022-06-23 20:38:10
mycli MyCLI is a command line interface for MySQL, MariaDB, and Percona with auto-completion and syntax highlighting. Source: https://github.com/dbcli ......

mycli

mycli is a command line interface for mysql, mariadb, and percona with auto-completion and syntax highlighting.

  • source:
  • chat: gitter
  • mailing list:

mysql命令行爱好者必备工具mycli

quick start

if you already know how to install python packages, then you can simply do:

$ pip install mycli

if you're on macos you can install it via homebrew.

$ brew update && brew install mycli

if you're having trouble with the quick start, check the page for detailed instructions.

usage

$ mycli --help
usage: mycli [options] [database]

  a mysql terminal client with auto-completion and syntax highlighting.

  examples:
    - mycli my_database
    - mycli -u my_user -h my_host.com my_database
    - mycli mysql://my_user@my_host.com:3306/my_database

options:
  -h, --host text               host address of the database.
  -p, --port integer            port number to use for connection. honors
                                $mysql_tcp_port.
  -u, --user text               user name to connect to the database.
  -s, --socket text             the socket file to use for connection.
  -p, --password text           password to connect to the database.
  --pass text                   password to connect to the database.
  --ssl-ca path                 ca file in pem format.
  --ssl-capath text             ca directory.
  --ssl-cert path               x509 cert in pem format.
  --ssl-key path                x509 key in pem format.
  --ssl-cipher text             ssl cipher to use.
  --ssl-verify-server-cert      verify server's "common name" in its cert
                                against hostname used when connecting. this
                                option is disabled by default.
  -v, --version                 output mycli's version.
  -v, --verbose                 verbose output.
  -d, --database text           database to use.
  -d, --dsn text                use dsn configured into the [alias_dsn]
                                section of myclirc file.
  --list-dsn                    list of dsn configured into the [alias_dsn]
                                section of myclirc file.
  -r, --prompt text             prompt format (default: "\t \u@\h:\d> ").
  -l, --logfile filename        log every query and its results to a file.
  --defaults-group-suffix text  read mysql config groups with the specified
                                suffix.
  --defaults-file path          only read mysql options from the given file.
  --myclirc path                location of myclirc file.
  --auto-vertical-output        automatically switch to vertical output mode
                                if the result is wider than the terminal
                                width.
  -t, --table                   display batch output in table format.
  --csv                         display batch output in csv format.
  --warn / --no-warn            warn before running a destructive query.
  --local-infile boolean        enable/disable load data local infile.
  --login-path text             read this path from the login file.
  -e, --execute text            execute command and quit.
  --help                        show this message and exit.

blogroll