Last Updated: February 25, 2016
·
1.044K
· novalore

Unreadable output? Display query results vertically!

The MySQL Command Line Interface is an essential tool to test queries and manage databases.

Unfortunately, when the output of a query has a lot of columns, they break onto new lines and the results are unreadable.

If you don't have enough screen-space try \G modifier. Use it instead of semicolon and the ouput will be gracefully rendered vertically.

So SELECT * FROM user; becomes SELECT * FROM user\G.

EDIT: Simply using mysql --auto-vertical-output the interface will automatically detect if the output is wider than your terminal and display it vertically.