mysql
's ego
commandFrom mysql
's help
command:
ego (\G) Send command to mysql server, display result vertically.
So by appending a \G
to your select
, you can get a very clean vertical output:
mysql> SELECT * FROM sometable \G
You can tell MySQL to use the less
pager with its -S
option that chops wide lines and gives you an output that you can scroll with the arrow keys:
mysql> pager less -S
Thus, next time you run a command with a wide output, MySQL will let you browse the output with the less
pager:
mysql> SELECT * FROM sometable;
If you're done with the pager and want to go back to the regular output on stdout
, use this:
mysql> nopager