Paging techniques for querying a large volume of MySQL Data in Linux

Source: Internet
Author: User

In Linux, MySQL (especially the MySQL client tool) is used for query. When there is a large amount of data, the page is quickly turned over and cannot be seen.

In Linux, you can view the data on each page. You can use the -- pager parameter.

For example, MySQL -- pager = more
Or MySQL -- pager = less

In this way, each page is displayed as full, and you will wait for the button to flip the page, for example, pressing the Space key. Press q to exit the query.

If -- pager = less is used, you can press the B key to flip the page and view the data you have already viewed. You can also move up and down rows by using the up and down arrow keys.

You can also use the pager command in MySQL, such
[Gulei @ ARCH1220 ~] $ MySQL EICSNEW
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with-

Welcome to the MySQL monitor. Commands end with; or g.
Your MySQL connection id is 15253 to server version: 5.0.17c-pro-gpl-cert

Type 'help; 'or 'H' for help. Type 'C' to clear the buffer.

MySQL> pager less-S
PAGER set to 'less-S'

Then you can use select to query the rows that are too wide (beyond the screen width). You can use the left and right arrow keys to roll horizontally, and the data is displayed neatly.

After you specify pager as less, all features of less can be used, including paging, left and right scrolling, and searching strings. Use man less to check the manual. There are more functions.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.