0

当我--quick option按照另一个网络发布中的建议运行 mysql 时, desc<table>会返回很多 -

--quick而当我在没有该选项的情况下运行 mysql 时会desc table返回正常输出。

表有 7 列...6 双和 1 日期列。

谢谢拉曼

4

1 回答 1

3

--quick: Do not cache each query result, print each row as it is received

Which means if you DESCRIBE a table, and MySQL wants the pretty print (you now, |'s between fields, and -'s around header & bottom), it does not know yet how long each field in the resultset is going to be, so it assumes the largest width that column may get for the 'boxing'. If you look at INFORMATION_SCHEMA.COLUMNS, you can see for instance COLUMN_COMMENT is varchar(1024), all those fields really add up. It may seem you only get -'s, but those are just the 'bottom' of the boxing, if you scroll up (assuming your scrollback is big enough), you'll see your desired data is there.

You can:

  • use \G as you delimiter for vertical output rather the boxed.
  • start the process with automatic vertical output with --auto-vertical-output
  • start the process with non-tabular / non-boxed output with mysql --quick -s
于 2013-04-05T22:28:37.643 回答