Using a better pager with MySQL

Rationale TL;DR

We’re using the CLI MySQL monitor and long lines are giving us a hard time

The solution

One solution is to use a pager like less. For example:

MariaDB [MyDatabase]> pager less -SFX

Another option I do prefer is to use pspq. Set it as your default pager with:

pager pspg -s 14 -X --force-uniborder --quit-if-one-screen

Let’s check its output:

pspq

Don’t forget to install pspq before using it. Your milleage may vary, depending on the distro…