If you are using the MySQL command line client regularly, the following scenario might be familiar to you: You run a select on a table, which contains a lot of fields. The output will not fit on one line, which means that it will be unreadable. Consider the following example:
mysql> SELECT * FROM posts LIMIT 1;+----+-------------+---------------------+---------------------+--------------------------------+--------------+---------------+--------------+----------+----------+-------------+----------------+-------------+---------------+-------------+---------+--------+---------------------+---------------------+-----------------------+-------------+-------+------------+-----------+----------------+---------------+| ID | post_author | post_date | post_date_gmt | post_content | post_title |post_category | post_excerpt | post_lat | post_lon | post_status | comment_status | ping_status |post_password | post_name | to_ping | pinged | post_modified | post_modified_gmt |post_content_filtered | post_parent | guid | menu_order | post_type | post_mime_type |comment_count |
+----+-------------+---------------------+---------------------+--------------------------------+--------------+---------------+--------------+----------+----------+-------------+----------------+-------------+---------------+-------------+---------+--------+---------------------+---------------------+-----------------------+-------------+-------+------------+-----------+----------------+---------------+
| 1 | 1 | 2004-01-17 18:17:37 | 2004-01-17 16:17:37 | We'll see what time brings ... | Hello world! | 1| | NULL | NULL | publish | closed | closed | | hello-world| | | 2004-01-17 18:17:37 | 2004-01-17 16:17:37 | | 0 | /?p=1| 0 | post | | 0 |
+----+-------------+---------------------+---------------------+--------------------------------+--------------+---------------+--------------+----------+----------+-------------+----------------+-------------+---------------+-------------+---------+--------+---------------------+---------------------+-----------------------+-------------+-------+------------+-----------+----------------+---------------+1 row in set (0.00 sec)
There is actually a nice solution for this. By default, the command line client uses horizontal mode to display the results of MySQL queries. If you use \G instead of ; or \g at the end of the line, your query result will be displayed in vertical mode, which will look a lot better:
mysql> SELECT * FROM posts LIMIT 1\G*************************** 1. row ***************************ID: 1post_author: 1post_date: 2004-01-17 18:17:37post_date_gmt: 2004-01-17 16:17:37post_content: We'll see what time brings ...post_title: Hello world!post_category: 1post_excerpt:post_lat: NULLpost_lon: NULLpost_status: publishcomment_status: closedping_status: closedpost_password:post_name: hello-worldto_ping:pinged:post_modified: 2004-01-17 18:17:37post_modified_gmt: 2004-01-17 16:17:37post_content_filtered:post_parent: 0guid: /?p=1menu_order: 0post_type: postpost_mime_type:comment_count: 01 row in set (0.00 sec)
While vertical output uses a lot more vertical space than the horizontal output, the vertical output is a lot more readable. Now you can probably see what I used as example query. It is actually the first post from this blog. Yes, this blog just got 6 years old ;).
If you want your command line client to use vertical mode by default, you can add vertical to the client section ([client]) of your .my.cnf file. This would look something like this:
[client]vertical