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.

How to limit query results scrolling off the screen

Answer:

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

  1. Clear screen in MySQL client
  2. How to check and kill long running MySQL query
  3. Enable Slow Query log in MySQL
  4. Explain query execution plan in MySQL
  5. Disable Query Cache at runtime when querying MySQL database

Leave a Reply

(required)

(required)

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>