mysql命令行中執(zhí)行多行命令時,如果前邊輸入的命令發(fā)生錯誤,是無法返回修改的,但是可以通過輸入\c來取消前邊的輸入,但是這時如果前邊輸入的東西很多,直接取消又很可惜的話,可以通過\p來打印出前邊的命令,復(fù)制下來去修改,然后輸入\c取消來重新輸入命令。
Example1 2 3 4 5 6 7 8 9 10 11 12 13 | mysql> select 8 from a
-> where 1=1
-> and 1=0
-> \p
#輸入\p后,打印出了前邊的命令。
--------------
select 8 from a
where 1=1
and 1=0
--------------
#依然進入->狀態(tài),等待輸入,輸入\c,取消當(dāng)前輸入。
-> \c
mysql>
|
下表列出了各個提示符并簡述它們所表示的mysql的狀態(tài):
提示符 |
含義 |
mysql> |
準備好接受新命令。 |
-> |
等待多行命令的下一行。 |
‘> |
等待下一行,等待以單引號(“’”)開始的字符串的結(jié)束。 |
“> |
等待下一行,等待以雙引號(“””)開始的字符串的結(jié)束。 |
`> |
等待下一行,等待以反斜點(‘`’)開始的識別符的結(jié)束。 |
/*> |
等待下一行,等待以/*開始的注釋的結(jié)束。 |
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 binlog
with multi-byte charsets.
warnings (\W) Show warnings after every statement.
nowarning (\w) Don't show warnings after every statement.
|