How would I undo or edit the last line of a multi-line query in mysql?
Type edit.

mysql&gt; edit


It would open a vi editor. You can make any number of mistakes and undo them.
Once done with your multiline query, exit(:wq) out the editor.
Type ; to execute your query.

mysql&gt; ;