How many of you use the mysql command-line client? And did you know about the pager command you can give it? It's pretty useful. It tells mysql to pipe the output of your commands through the specified program before displaying it to you.
Here's the most basic thing I can think of to do with it: use it as a pager. (It's scary how predictable I am sometimes, isn't it?)
PLAIN TEXT SQL:
- mysql> pager less
- mysql> SHOW innodb STATUS\G
For big result sets, it's a pretty handy way to be able to search and scroll through. No mouse required, of course.
But it doesn't have to be this simple! You can specify anything you want as a pager. Hmm, you know what that means? It means you can write your own script and push the output through it. You can't specify arguments to the script, but since you can write your own, that's not really a …
[Read more]