MySQL command line, how to cancel/return to modify the command in front of the multi-line command

Source: Internet
Author: User
Tags mysql command line

MySQL command line when executing a multi-line command, if the command entered in front of an error, is unable to return the modification, but can be input \c to cancel the front input, but at this time if the front input a lot of things, the direct cancellation and unfortunately, can be \p to print out the front of the command, copied down to modify, Then enter \c Cancel to re-enter the command.

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>

The following table lists the individual prompts and describes the status of the MySQL that they represent:

Prompt Meaning
Mysql> Be ready to accept the new command.
- Wait for the next line of the multiline command.
' > Wait for the next line, waiting for the end of the string to begin with single quotation marks ("'").
"> Wait for the next line, waiting for the end of the string to begin with double quotation marks ("" ").
' > Waits for the next line, waiting for the end of the qualifier to begin with a backslash (' ').
/*> Wait for the next line, and wait for the end of the comment to start with/*.

MySQL Help list

? (\?) Synonym for "help". Clear (\c) clear the current input statement.connect (\ r) reconnect to the server. Optional arguments is DB and Host.delimiter (\d) Set statement Delimiter.ego (\g) Send command to MySQL server, dis Play 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_outf Ile]. Append everything into given outfile.use (\u) use another database. Takes database name as Argument.charset (\c) Switch to another charset. Might is needed for processing Binlogwith multi-byte charsets.warnings (\w) Show warnings after every STATEMENT.NOwarning (\w) Don ' t show warnings after every statement. 

MySQL command line, how to cancel/return to modify the preceding command when multiple lines of command

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.