Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Jan 162010

How to limit query results scrolling off the screen


If you have a query which return a very large result, and you want to use a pager such as less to control, you can use the following command in the mysql client.

mysql> pager less;
PAGER set to 'less'

mysql> select * from very_large_table;

To turn off the pager

mysql> nopager;
PAGER set to stdout

 Leave a Reply



You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>