arny660 Posted June 20, 2011 Share Posted June 20, 2011 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 More sharing options...
Stuart Posted June 20, 2011 Share Posted June 20, 2011 I was under the impression you just pressed up... quick google people have suggested shift+page up and shift+up arrow? Either of those work for you? Link to comment Share on other sites More sharing options...
Larry Posted June 21, 2011 Share Posted June 21, 2011 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 More sharing options...
HartleySan Posted June 21, 2011 Share Posted June 21, 2011 arny, you might also want to consider using a more user-friendly SQL-querying tool, such as phpMyAdmin. phpMyAdmin is built into XAMPP and almost all servers. It provides a web GUI, which is much easier to deal with. Link to comment Share on other sites More sharing options...
Josee Posted June 21, 2011 Share Posted June 21, 2011 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 More sharing options...
Recommended Posts