溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

實(shí)用工具mycli:MySQL、MariaDB 和 Percona 的命令行界面

發(fā)布時(shí)間:2020-05-22 14:48:22 來源:網(wǎng)絡(luò) 閱讀:1928 作者:不忘少年歌 欄目:MySQL數(shù)據(jù)庫

mycli 是默認(rèn)的 MySQL 客戶端的現(xiàn)代替代品,mycli 將在你輸入時(shí)自動(dòng)補(bǔ)全關(guān)鍵字、表名、列和函數(shù)。


HomePage: http://mycli.net


使用效果如下:

實(shí)用工具mycli:MySQL、MariaDB 和 Percona 的命令行界面

RHEL, Centos安裝方式:

        目前作者沒有針對(duì)RHEL, Centos提供RPM包,暫時(shí)可用pip方式安裝:

        $ sudo yum install python-pip

        $ sudo git clone https://github.com/dbcli/mycli

        $ sudo pip install 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

      --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 query to the database.

      --help                        Show this message and exit.


使用示例:

        

    $ mycli local_database

    $ mycli -h localhost -u root app_db

    $ mycli mysql://amjith@localhost:3306/django_poll

    

報(bào)錯(cuò)解決:

        出現(xiàn)下如下錯(cuò)誤:

        error: command 'gcc' failed with exit status 1  

        表示有依賴包未裝全,解決辦法:

        $ sudo yum install python-devel mysql-devel zlib-devel openssl-devel


向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI