你怎么看到mysql客户端的字段注释?

时间:2011-10-20 11:14:23

标签: mysql database-design documentation comments

我希望看到各个字段的评论。通常我会从“描述”参数中得到一些东西。

mysql> describe metrics;
+-------+---------------------+------+-----+---------+----------------+
| Field | Type                | Null | Key | Default | Extra          |
+-------+---------------------+------+-----+---------+----------------+
| id    | int(10) unsigned    | NO   | PRI | NULL    | auto_increment |
| ty    | int(10) unsigned    | NO   |     | NULL    |                |
| t     | bigint(20) unsigned | NO   |     | NULL    |                |
| s     | int(10) unsigned    | NO   |     | 60000   |                |
| e     | int(10) unsigned    | NO   |     | NULL    |                |
| c     | int(10) unsigned    | NO   |     | NULL    |                |
+-------+---------------------+------+-----+---------+----------------+

3 个答案:

答案 0 :(得分:67)

show full columns from <table_name>

这是输出:

| Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment

我希望这对你有用

答案 1 :(得分:12)

此查询将为您提供比describe语句更多的信息:

SELECT * 
FROM information_schema.columns 
WHERE table_name = 'metrics'
AND table_schema = '...' -- Optionally, filter the schema as well, to avoid conflicts

答案 2 :(得分:3)

总是可以使用:

 Food:<input type = "text" name="food" id="food" value ="" size ="22" placeholder ="Enter your Favourite food"/><br>     Drink:<input type = "text" name="Ofood" id="Ofood" value="" size="22" placeholder="Enter your Favourite Drink"/><br>`     Restaurant:<input type = "text" name="Pfood" id="Pfood" value="" size="22" placeholder="name your best restaurant"/>