How to best display in Terminal a MySQL SELECT returning too many fields?

后端 未结 12 897
你的背包
你的背包 2020-12-04 04:32

I\'m using PuTTY to run:

mysql> SELECT * FROM sometable;

sometable has many fields and this results in many columns trying

12条回答
  •  天涯浪人
    2020-12-04 05:04

    Terminate the query with \G in place of ;. For example:

    SELECT * FROM sometable\G
    

    This query displays the rows vertically, like this:

    *************************** 1. row ***************************
                     Host: localhost
                       Db: mydatabase1
                     User: myuser1
              Select_priv: Y
              Insert_priv: Y
              Update_priv: Y
              ...
    *************************** 2. row ***************************
                     Host: localhost
                       Db: mydatabase2
                     User: myuser2
              Select_priv: Y
              Insert_priv: Y
              Update_priv: Y
              ...
    

提交回复
热议问题