I'm a newbie to mySQL and I was trying to insert some data into the database from the mysql command prompt but I've stuffed up and I'm stuck at a command prompt like the following
but I don't know how to get back to the mysql command prompt without closing the terminal window.
possibly it's waiting for you to close a string, try entering a single quote
i ended up just closing the terminal window. Is there anyway to exit the sql command prompt if you get the syntax wrong and can't work out how to fix it?
look at Rudy's explanation.
If you enter ('2006-01-01); then you are missing a single quote thus instead of seeing
on the prompt you got
so you just now need to enter
which is the character being asked for and then the semi-colon to close the command off.
if you are missing a double quote you would see
just enter ";
to close it off.
closing the window won't hurt anything either.
also one other thing to note, if you realize you have made an error in your query and you want to go back and fix something enter \c at the prompt and then you will end your query and just go back to the prompt.
This topic is now archived. It is frozen and cannot be changed in any way.