mysql命令列,多行命令時如何取消/返回修改前邊的命令

來源:互聯網
上載者:User

標籤:

mysql命令列中執行多行命令時,如果前邊輸入的命令發生錯誤,是無法返回修改的,但是可以通過輸入\c來取消前邊的輸入,但是這時如果前邊輸入的東西很多,直接取消又很可惜的話,可以通過\p來列印出前邊的命令,複製下來去修改,然後輸入\c取消來重新輸入命令。

Example
12345678910111213 mysql> select 8 from a    -> where 1=1    ->  and 1=0    -> \p#輸入\p後,列印出了前邊的命令。--------------select 8 from awhere 1=1 and 1=0--------------#依然進入->狀態,等待輸入,輸入\c,取消當前輸入。    -> \cmysql>

 

下表列出了各個提示符並簡述它們所表示的mysql的狀態:

提示符 含義
mysql> 準備好接受新命令。
-> 等待多行命令的下一行。
‘> 等待下一行,等待以單引號(“’”)開始的字串的結束。
“> 等待下一行,等待以雙引號(“””)開始的字串的結束。
`> 等待下一行,等待以反斜點(‘`’)開始的識別符的結束。
/*> 等待下一行,等待以/*開始的注釋的結束。

mysql help列表

?         (\?) 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.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.notee     (\t) Don‘t write into outfile.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.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 binlogwith multi-byte charsets.warnings  (\W) Show warnings after every statement.nowarning (\w) Don‘t show warnings after every statement.

mysql命令列,多行命令時如何取消/返回修改前邊的命令

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.