[MySQL]mycli初體驗-自動補全

早就聽說mycli很好用,今天打算在本地測試機上裝一下體驗一把。
安裝方法很是簡單:

一、安裝依賴:

yum install python-pip python-devel

二、安裝mycli

pip install mycli

這樣就安裝完了。

三、使用方法

[root@localhost .pip]# 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.
  -D, --database TEXT           Database to use.
  -d, --dsn TEXT                Use 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.

參數(shù)選項不多,直接當成mysql客戶端來使用即可。

四、體驗

mycli -u用戶名 -p密碼


image.png

體驗了一下,還是挺不錯的,語法高亮,還能自動補全。

最后編輯于
?著作權歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內(nèi)容

  • 早就聽說mycli很好用,今天打算在本地測試機上裝一下體驗一把。安裝方法很是簡單: 一、安裝依賴: 二、安裝myc...
    拾荒者charley閱讀 4,366評論 0 1
  • 什么是數(shù)據(jù)庫? 數(shù)據(jù)庫是存儲數(shù)據(jù)的集合的單獨的應用程序。每個數(shù)據(jù)庫具有一個或多個不同的API,用于創(chuàng)建,訪問,管理...
    chen_000閱讀 4,124評論 0 19
  • feisky云計算、虛擬化與Linux技術筆記posts - 1014, comments - 298, trac...
    不排版閱讀 4,277評論 0 5
  • 環(huán)境:sudo docker pull ubuntu:14.04 # docker默認都是64位系統(tǒng)mkis...
    97690CE50CC872D閱讀 3,000評論 1 1
  • 高考已經(jīng)結束了,再過幾天分數(shù)就會揭曉。每個省、每個市都會產(chǎn)生高考狀元,他們無疑會成為北大、清華等一流名校爭相搶奪的...
    薇爸微世界閱讀 1,591評論 0 2

友情鏈接更多精彩內(nèi)容