Pagination in mysql CLI
Ever wonder how to scroll upwards in mysl resultset ?
What if your terminal doesn’t allow scrollback or the scrollback buffer is somehow set to sreen lines ?
How to use MORE or LESS unix commands in mysql which would allow to scroll using ‘return’ or ‘spacebar’
Follow the steps given below:
[Invoke mysql using the --page command]
-
mysql --page uuser -p
-
mysql> pager less
-
mysql> select * from table_name
[set the pager to use less]
[run your query]
This also works under the unix ‘screen’ terminal emulation
Tags: cli, less, more, MySQL, pagination, prompt, screen, scroll
1 Comment
Comments RSS
TrackBack Identifier URI
Leave a comment
Good tips. I am really looking for soemthing like this..Thanks
Comment by Dileep on October 23, 2008 4:09 am