Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to modify the previous command when there is an input error at the MySQL command prompt

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article is about how to modify the previous command when there is a typing error at the MySQL command prompt. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Current problem

When typing multiple lines of commands at the MySQL command prompt, it is a headache to suddenly find that there is an error in the front. Most people know that you can cancel the previous input by typing\ c and re-enter the "mysql- >" prompt directly. But if the previous input is too much, it is a pity to cancel it directly, which requires us to re-type the instruction. if we copy it directly, each line will be preceded by a "- >" symbol, so it will take time to delete the previous symbols.

Solution process

In this case, you can type\ p, all your previous inputs will pop up at the command prompt window, then select what you want to copy (Ctrl+C), Ctrl+V (paste) into a text box, and then copy the errors and paste them to the command prompt window to execute the command.

Concrete steps

That is, enter\ p → to select the content to be copied (Ctrl+C) → paste into other text boxes (that is, where you are convenient to paste and modify) → copy and modify the correct content → enter\ c in the command prompt window, first end the previous command → Ctrl+V paste the modified content → execute the command.

Solve a case

Example: the misspelling of "jion" in the fifth line needs to be changed to "join"

Enter multiple lines of command and find the previous misspelling of "jion". Enter\ p

Copy the content you need between the two dotted lines

Selecte.ename,d.dnamefromemp eright jiondept done.deptno = d.deptno

Paste anywhere else and change "jion" to "join".

Execute the command, run successfully

By the way, write the shortcut command of MySQL.

The following table lists the prompts and a brief description of the status they represent:

The prompt means mysql > is ready to accept the new command. -> wait for the next line of the multiline command.' Wait for the next line, for the end of a string that begins with single quotation marks ("'"). Wait for the next line, waiting for the end of a string that begins with double quotes (""). / * > wait for the next line, waiting for the end of the comment that starts with / *. Thank you for reading! This is the end of this article on "how to modify the previous command when there is an error in the MySQL command prompt". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report