在Mysql的命令行工具里面给select查询加入一个\G参数。横向的表结构会转为使用纵向表结构输出,利于阅读。
原先执行:select * from my_user limit 3;
看似不错,其实在命令行下基本没法阅读,因为一行超过了80字符的限制,折行后根本就不适合人类阅读。
改为执行:select * from my_user limit 3\G;
mysql> select * from my_user limit 3\G;
*************************** 1. row ***************************
id: 1
uid: 1081085651
uname: ÄÎÖ®ÎÒºÎ
uhost: xxmm
gender: 1
birthday: 1983-02-08
province: 21
city: 5
pcsite:
email: dearfaint@163.com
mobile:
m_icon: 1
m_sign:
m_vipuser: 3
m_pubuser: 0
m_dock: 1
x_viability: 50
x_selling: 100
x_exploit: 0
x_point: 0
signup_time: 2005-08-10 17:39:35
signup_ip: 221.203.110.20
status: 2
knote:
kstatus: 0
ktime: 0000-00-00 00:00:00
uppdate: 2005-10-08 15:01:42
uppip: 222.62.221.22
plat_status: 1
*************************** 2. row ***************************
id: 2
uid: 1147871460
uname: Å®ÈË»¨
uhost:
gender: 2
birthday: 1981-01-15
province: 11
city: 1
pcsite:
email: myclub001@sina.com
mobile:
m_icon: 0
m_sign:
m_vipuser: 3
m_pubuser: 0
m_dock: 1
x_viability: 50
x_selling: 100
x_exploit: 0
x_point: 0
signup_time: 2005-03-01 08:46:09
signup_ip: 192.168.212.30
status: 2
knote:
kstatus: 0
ktime: 0000-00-00 00:00:00
uppdate: 0000-00-00 00:00:00
uppip: 000:000:000:000
plat_status: 1
*************************** 3. row ***************************
id: 3
uid: 1414907424
uname: ²Êºç
uhost: caihong
gender: 2
birthday: 1977-09-20
province: 11
city: 1
pcsite:
email: caihong77@sina.com
mobile:
m_icon: 1
m_sign:
m_vipuser: 3
m_pubuser: 0
m_dock: 2
x_viability: 50
x_selling: 100
x_exploit: 0
x_point: 0
signup_time: 2005-03-29 11:44:04
signup_ip: 10.218.23.114
status: 2
knote:
kstatus: 0
ktime: 0000-00-00 00:00:00
uppdate: 2006-04-24 10:02:13
uppip: 10.218.23.162
plat_status: 1
3 rows in set (0.06 sec)
转载自:http://blog.sina.com.cn/s/blog_606dc26a0100g8tq.html