GNU/Linux >> Linux の 問題 >  >> Ubuntu

Ubuntu 20.04 に MyCli をインストールする方法

この記事では、Ubuntu 20.04 LTS に MyCli をインストールして構成するために必要な手順について説明しました。このチュートリアルを続行する前に、sudo を持つユーザーとしてログインしていることを確認してください 特権。このチュートリアルのすべてのコマンドは、root 以外のユーザーとして実行する必要があります。

CLI は、MySQL、MariaDB、および Percona 用のコマンドライン インターフェースで、オートコンプリートと構文の強調表示を備えています。オートコンプリートは、クエリをより速く簡単に作成するのに役立ちます。 REPL (Read、Eval、Print、Loop) は、入力を開始するとすぐに提案メニューをポップアップ表示します。提案は、カーソルの位置に基づくコンテキストです。

MyCLI の機能

  • データベースのテーブル、ビュー、列だけでなく、SQL キーワードの入力時に自動補完
  • 入力中の入力のシンタックス ハイライト
  • 複数行クエリのサポート
  • お気に入りのクエリを保存できます。
  • 魅力的な方法で表形式のデータを印刷します。
  • SSL 接続のサポート
  • スマート補完 (デフォルトで有効) は、状況に応じた補完を提案します。
  • すべてのクエリとその結果をファイルに記録する

MyCli を Ubuntu 20.04 にインストール

ステップ 1. まず、Ubuntu サーバーにパッケージをインストールする前に、すべてのシステム パッケージが更新されていることを確認することを常にお勧めします。

sudo apt update
sudo apt upgrade

ステップ 2. Ubuntu システムに MyCli をインストールします。

  • 公式リポジトリから MyCli をインストールする

次のコマンドを使用して MyCLI パッケージをインストールします:

sudo apt install mycli
  • Snap 経由で MyCli をインストールする

以下のコマンドを実行して、スナップと MyCli をインストールします:

sudo apt install snapd
sudo snap install mycli

ステップ 3. Ubuntu で MyCli を使用する

MyCli の使用は非常に簡単です。なぜなら、MyCli は MySQL シェルを置き換えるものではなく、より多くの優れた機能を提供するためのものだからです。したがって、コマンド ヘルプをデプロイするには、ターミナルを開いて実行するだけです:

# 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 \[email protected]\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.
  -e, --execute TEXT            Execute query to the database.
  --help                        Show this message and exit.

MyCli を Ubuntu 20.04 LTS Focal Fossa にインストールするために必要なことはこれだけです。この簡単なヒントがお役に立てば幸いです。 MyCli の詳細については、公式ナレッジ ベースを参照してください。ご質問やご提案がありましたら、お気軽にコメントを残してください。


Ubuntu
  1. Ubuntu20.04にRをインストールする方法

  2. Ubuntu20.04LTSにSublimeTextをインストールする方法

  3. Ubuntu18.04にSublimeText3をインストールする方法

  1. Ubuntu18.04にGoをインストールする方法

  2. Ubuntu18.04にRをインストールする方法

  3. Ubuntu18.04にSublimeText3をインストールする方法

  1. Ubuntu18.04にAtomテキストエディターをインストールする方法

  2. Ubuntuの20.04で崇高なテキスト3をインストールする方法

  3. Ubuntu20.04にSublimeText4をインストールする方法