ホームページ  >  記事  >  データベース  >  MySQL クライアント コマンド

MySQL クライアント コマンド

WBOY
WBOY転載
2023-09-07 21:13:051181ブラウズ

MySQL 客户端命令

MySQL クライアント コマンドをいくつか理解しましょう -

MySQL は、ユーザーが発行したすべての SQL ステートメントを実行のためにサーバーに送信します。 mysql 自体が解釈する一連のコマンドもあります。

コマンドのリストを取得する

プロンプトで以下のコマンドを入力すると、これらのコマンドのリストが表示されます。

mysql> help

出力

List of all MySQL commands:
Note that all text commands must be first on line and end with ';'
? (\?) Synonym for `help'.
clear     (\c) Clear the current input statement.
connect   (\r) Reconnect to the server. Optional arguments are db and host.
delimiter (\d) Set statement delimiter.
edit      (\e) Edit command with $EDITOR.
ego       (\G) Send command to mysql server, display result vertically.
exit      (\q) Exit mysql. Same as quit.
go        (\g) Send command to mysql server.
help      (\h) Display this help.
nopager   () Disable pager, print to stdout.
notee     (\t) Don't write into outfile.
pager     (\P) Set PAGER [to_pager]. Print the query results via PAGER.
print     (\p) Print current command.
prompt    (\R) Change your mysql prompt.
quit      (\q) Quit mysql.
rehash    (\#) Rebuild completion hash.
source    (\.) Execute an SQL script file. Takes a file name as an argument.
status    (\s) Get status information from the server.
system    (\!) Execute a system shell command.
tee       (\T) Set outfile [to_outfile]. Append everything into given    outfile.
use       (\u) Use another database. Takes database name as argument.
charset   (\C) Switch to another charset. Might be needed for processing  binlog with multi-byte charsets.
warnings  (\W) Show warnings after every statement.

「--binary-mode」オプションを使用して mysql を呼び出す場合、入力が mysql にパイプされるか、source コマンドを使用してロードされると仮定すると、非対話モードの文字セットと区切り文字を除くすべての mysql コマンドが無効になります。

各コマンドには長い形式と短い形式があります。

長い形式のコマンド

長い形式では大文字と小文字が区別されませんが、短い形式では大文字と小文字が区別されます。長い形式の後にはオプションのセミコロン終端文字を続けることができますが、短い形式の後には何も続けないでください。

短い形式のコマンド

複数のコマンドで短い形式のコマンドを使用する -line /* ... */ コメントはサポートされていません。短縮コマンドは 1 行 /*! 内で機能します。 ... */ バージョン コメント、/* ... */ オプティマイザー ヒント コメントも同様です。これらはオブジェクト定義に保存されます。

以上がMySQL クライアント コマンドの詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

声明:
この記事はtutorialspoint.comで複製されています。侵害がある場合は、admin@php.cn までご連絡ください。