Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to go up a line to fix a mistake in command line? MySQL console

Tags:

mysql

I really looked hard and long and is there really no way to go up a line to fix a typo without having to type my query all over again?

I am using MySQL console on Windows 7.

If not, what should I be using to learn MySQL?

like image 965
Tim Avatar asked Jan 12 '12 01:01

Tim


People also ask

How do you go up a line in MySQL command?

just press the up arrow on your keyboard once or several times! it also works even if you let your queries span several rows :) this is also good for repeating lines.

How do I get out of MySQL error?

Just end the command with a semicolon ";". MySQL will display an error message and let you continue.


1 Answers

Using \e will allow you to edit the command by opening it up in text editor

edit      (\e) Edit command with $EDITOR.

http://dev.mysql.com/doc/refman/5.7/en/mysql-commands.html

like image 85
Matthew Warman Avatar answered Oct 07 '22 15:10

Matthew Warman