Another exceedingly useful feature of the mysql command-line client is that all of the commands executed for a given session are kept in a buffer for examination and reuse.
If you want to revisit commands you have run, press the up arrow (or CTRL+p). To scroll back down through the entries, press the down arrow (or CTRL+n). If you want to rerun a query you are examining, press Enter. Alternatively, you can edit the query (just as you would any query you had typed in), and then rerun it.
If you want to search through the command history, press CTRL+r and then begin typing in part of a previous command. The last command, if any, that matches what you have typed is displayed. To find the previous matching entry, press CTRL+r again.
To return to the end of the history buffer, press ALT+>. Similarly, to see the first entry in the history buffer, press ALT+<.