Nov 8, 2018

MySQL command-line pager - pipe the output of your commands through the specified program

pager command in MySQL client tells mysql to pipe the output of your commands through the specified program before displaying it to you.

mysql> pager less
mysql> show processlist\G;

You can write your own script and push the output through it.

$ cat /tmp/sleep

grep 'Sleep'


mysql> pager /tmp/sleep
mysql> show processlist;