Friday, November 28, 2008

When MySQL splashes back too much

Splashing Atlantic Bottlenose
Sometimes MySQL is too helpful. Recently I was helping a very large man working on a very small laptop that had an overly sensitive mouse. Trying to scroll back and forth to examine the system variables with the mysql command-line client was very painful. It reminded me of the Atlantic Bottlenose Dolphin named Kai at the Texas State Aquarium pictured here that was too helpful when I tried to get him to splash 'just a little' for a picture. In this case the server was returning too much to see and the very large man in frustration handed his computer to me.

mysql> pager more
PAGER set to 'more'

I returned the laptop and the very large man could now control the scrolling. After a few moments we found what we were looking for.

'So how do I turn this pager off?'

mysql> nopager
PAGER set to stdout

You can set the pager to a file or a program on any system but Windows (no popen() function). And it is one of those little things you need to pass on to MySQL novices to keep them from trying to 'drink from a fire hose'.

1 comment:

Sheeri K. Cabral said...

yep! I use the


abbreviation to turn it on and off. It's actually very useful, and you can use something like "more" or "less" or even "grep". For example, recently I did:

\P grep root

to be able to see all the processes owned by root on a 5.0 server. The 2nd \P will revert it back to stdout.

very, very useful. That and ending commands with \G instead of ; helps (vertical mode, for those that don't know what it is, try it with SHOW PROCESSLIST\G sometime).