讓我們了解一些 MySQL 客戶端命令 –
MySQL 會(huì)將用戶發(fā)出的每條 SQL 語句發(fā)送到服務(wù)器以便執(zhí)行。還有一組 mysql 自己解釋的命令。
獲取命令列表
可以通過在提示符下鍵入下面提到的命令來找到這些命令的列表-
mysql> help
登錄后復(fù)制
輸出
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.
登錄后復(fù)制
如果使用“–binary-mode”選項(xiàng)調(diào)用 mysql,則假定輸入通過管道傳送到 mysql 或使用 source 命令加載,則除了非交互模式下的字符集和分隔符外,所有 mysql 命令都將被禁用。
每個(gè)命令都有長(zhǎng)格式和短格式。
長(zhǎng)格式命令
長(zhǎng)格式不區(qū)分大小寫,短格式區(qū)分大小寫。長(zhǎng)格式后面可以跟一個(gè)可選的分號(hào)終止符,但短格式后面不應(yīng)跟任何內(nèi)容。
短格式命令
在多個(gè)命令中使用短格式命令-line /* … */ 不支持注釋。簡(jiǎn)寫命令在單行 /* 內(nèi)工作! … */ 版本注釋,/*+ … */ 優(yōu)化器提示注釋也是如此。它們存儲(chǔ)在對(duì)象定義中。
以上就是MySQL 客戶端命令的詳細(xì)內(nèi)容,更多請(qǐng)關(guān)注www.92cms.cn其它相關(guān)文章!






