Jump to content
Larry Ullman's Book Forums

Clearing An Error On Mysql Client


Recommended Posts

Hi

 

I`m new to this forum, and also new to php/mysql, so please bear with me.

 

I am currently learning how to use mysql client, but I can't figure out how to amend an error after I have entered the semi-colon and pressed Enter.

 

Quite often I have typed a long passage of commands, only to find after I have pressed Enter that I have made an error. As I can't get it amended, I have to start all over again.

 

The book does say to use the arrow keys and and scroll up until I find the line with the error it in, but this doesnt seem to work. I can scroll up but I cant seem to get the line amended.

 

Could anybody help me this please,

 

Many thanks,

 

Arnold

Link to comment
Share on other sites

Well, you can't "amend" the error, exactly. What you can do is use the up key to find the problematic line, edit it, and hit enter. Note that you have to keep the whole syntax of the query intact, meaning that if the query goes over multiple lines, you'd need to use the up key multiple times and do it in the right order.

 

If this still doesn't make any sense, it'd help to know what version of MySQL you're using, on what operating system, and what an example is of something you're having problems with.

Link to comment
Share on other sites

I had the same problems with the command-line to start with, and as HartleySan suggests, using phpMyAdmin can be a more friendly way of getting familiar with SQL. Another way round is to prepare your command in a text editor, and once you are sure you haven't made any mistakes, just paste it in Terminal or another client, and hit return. I've got used to the command-line but I still use a text editor first when I want to use Terminal for a long command, as correcting typos can really be hard work!

Link to comment
Share on other sites

 Share

×
×
  • Create New...