MySQL Tip – Paging your results in the MySQL CLI

by Vid Luther on April 13, 2006

in Uncategorized

We all deal with queries that return more rows than what our screen will let us view, wouldn’t it be nice to be able paginate the results ?
Rather than having to scroll back, and scan the rows, you can use the built in pager. I didn’t know about this, until Will from freenode mentioned it in #mysql. Long story short..

mysql> \P less
mysql> PAGER set to less
mysql> select foo,bar from table

The format is much more readable than usual. Some of you may have already known about this, but I didn’t. So I hope it’s helpful.

blog comments powered by Disqus

Previous post:

Next post: