• Skip to primary navigation
  • Skip to main content
Sal Ferrarello
  • About Sal Ferrarello
  • Speaking
  • Connect
    Mastodon GitHub Twitter (inactive)
You are here: Home / Draft / MySQL Paging Lots of Results

MySQL Paging Lots of Results

Last updated on May 8, 2018 by Sal Ferrarello

I’ve recently moved to using the terminal program alacritty, which does not natively do paging. This is not generally a problem since I can pipe results to less.

$ ls dir-w-lots-of-files | less

However, I found myself working in command line MySQL and I got LOTS of results but could not page back.

It turns out you can set a pager in MySQL. Running the command pager less, sets less to be the pager.

MySQL> pager less

Now, I can get lots of results and review them with the standard less commands (including search).

Note: I’ve gone back to using iTerm but I still find using the pager in MySQL helpful at times.

Sal Ferrarello
Sal Ferrarello (@salcode)
Sal is a PHP developer with a focus on the WordPress platform. He is a conference speaker with a background including Piano Player, Radio DJ, Magician/Juggler, Beach Photographer, and High School Math Teacher. Sal can be found professionally at WebDevStudios, where he works as a senior backend engineer.

Share this post:

Share on TwitterShare on FacebookShare on LinkedInShare on EmailShare on Reddit
Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft Tagged With: command line, MySQL

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Copyright © 2023 · Bootstrap4 Genesis on Genesis Framework · WordPress · Log in