How do you clear an unexecuted MySQL query from the command line? How do you clear an unexecuted MySQL query from the command line? mysql mysql

How do you clear an unexecuted MySQL query from the command line?


Type \c.

When you start up MySQL, you'll likely see this message:

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

The "buffer" that it's referring to is the command/query buffer.


First type Ctrl+a, then Ctrl+k.


Use one of the following shortcuts to delete the current line:

  • Type Ctrl + u to delete everything from the cursor back to the line start
  • Type Ctrl + k to delete everything from the cursor to the end of the line

Otherwise as already indicated type \c at the end of the current line (a shortcut for the clear command) and then press Enter.