2

So if I open up a Mysql CLI and run a select statement that includes many columns and row content that is long, mysql will render this depending on my window resolution. If my screen is small and a row doesn't fit, it will cut in half and display the second half of the row on a second line. I am looking for a way to output the rows as a continuous line (so they can be read easily) and then use a command to tab to the right and see the second half of the content. Any ideas on how to achieve this?

1 Answer 1

2

I usually use the --vertical commandline option which will print a column:value pair on each line, rather then wrapping lines.

With the --pager option you should be able to use a different pager, such as less, more or a custom one.

The MySQL manual has a number of examples to use a custom pager, including the following example:

mysql> pager less -n -i -S
mysql> select * from mysql.user; 

And then scroll from left to right...

In the preceding example, note the -S option. You may find it very useful for browsing wide query results. Sometimes a very wide result set is difficult to read on the screen. The -S option to less can make the result set much more readable because you can scroll it horizontally using the left-arrow and right-arrow keys. You can also use -S interactively within less to switch the horizontal-browse mode on and off. For more information, read the less manual page.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .