伍佰目录 短网址
  当前位置:海洋目录网 » 站长资讯 » 站长资讯 » 文章详细 订阅RssFeed

MySQL的增强型语法高亮终端-MyCli

来源:本站原创 浏览:71次 时间:2023-07-03
MyCli简介

MyCli是一个MySQL的命令行客户端,可以实现自动补全(auto-completion)和语法高亮。MyCli也可用于MariaDB和Percona。

项目地址:http://mycli.net/

特性

  • MyCli使用Python Prompt Toolkit编写。

  • 支持语法高亮

  • 当你输入SQL关键字,数据库的表格和列时可自动补全。

  • 智能补全(默认启用),会提示文本感应的(context-sensitive)补全。

  • 配置文件在第一次启动时,自动创建在~/.myclirc

效果展示


MyCli安装

如果你已会安装Python包,那就简单了

$ pip install mycli

如果你是在OS X平台,那就用homebrew

$ brew update && brew install mycli
MyCli使用
$ mycli --help                        Usage: mycli [OPTIONS] [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                 Version of mycli.  -D, --database TEXT           Database to use.  -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 config group with the specified suffix.  --defaults-file PATH          Only read default options from the given 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.  --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.  --help                        Show this message and exit.
MyCli示例
  • 用root登陆到数据库

$ mycli -h localhost -u root -p123Version: 1.7.0Chat: https://gitter.im/dbcli/mycliMail: https://groups.google.com/forum/#!forum/mycli-usersHome: http://mycli.netThanks to the contributor - www.mysqlfanboy.commysql root@localhost:(none)>
  • 用root登陆并连接到数据库tpcc

$ mycli mysql://root@localhost:3306/tpccVersion: 1.7.0Chat: https://gitter.im/dbcli/mycliMail: https://groups.google.com/forum/#!forum/mycli-usersHome: http://mycli.netThanks to the contributor - Magnus uddmysql root@localhost:tpcc>


  推荐站点

  • At-lib分类目录At-lib分类目录

    At-lib网站分类目录汇集全国所有高质量网站,是中国权威的中文网站分类目录,给站长提供免费网址目录提交收录和推荐最新最全的优秀网站大全是名站导航之家

    www.at-lib.cn
  • 中国链接目录中国链接目录

    中国链接目录简称链接目录,是收录优秀网站和淘宝网店的网站分类目录,为您提供优质的网址导航服务,也是网店进行收录推广,站长免费推广网站、加快百度收录、增加友情链接和网站外链的平台。

    www.cnlink.org
  • 35目录网35目录网

    35目录免费收录各类优秀网站,全力打造互动式网站目录,提供网站分类目录检索,关键字搜索功能。欢迎您向35目录推荐、提交优秀网站。

    www.35mulu.com
  • 就要爱网站目录就要爱网站目录

    就要爱网站目录,按主题和类别列出网站。所有提交的网站都经过人工审查,确保质量和无垃圾邮件的结果。

    www.912219.com
  • 伍佰目录伍佰目录

    伍佰网站目录免费收录各类优秀网站,全力打造互动式网站目录,提供网站分类目录检索,关键字搜索功能。欢迎您向伍佰目录推荐、提交优秀网站。

    www.wbwb.net