I cant find anything about this from searching here.
I use mysql on the command line at work and I work with fairly large tables so I set the mysql pager allowing a more readable result if I run a query, that returns 1000's of results. I use the command below to set the pager.
\P less -Sin
This suits my needs but has left me wondering if there are any more pager styles that mysql uses on the command line.
The MySQL client just passes its output to whatever command you specify with
\P
(for "Pager").-Sin
are commandline switches to the programless
. From man less:For more options of the MySQL client, see reference.
This post is old, but still very helpful.
You can set the pager to whatever you want, including a script that parses all output before feeding it back to you. The examples there include using an add-on tool that makes
EXPLAIN
output more readable.Also note that to turn off this functionality and return to normal stdout the command is
nopager
.If you don't like
less
you can usemore
:)You might want to try pspg: Unix pager designed for work with tables. Designed for PostgreSQL, but MySQL is supported too.
In action: