如何查看mysql客户机的表注释?

时间:2022-04-23 03:52:02

I would like to see individual fields comments. Typically something I would expect from "describe" parameters.

我希望看到个别字段的注释。通常情况下,我希望“描述”参数。

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 个解决方案

#1


12  

This query will give you much more information than the describe statement:

这个查询将提供比描述语句更多的信息:

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

#2


53  

show full columns from <table_name>

This is the output:

这是输出:

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

I hope this is useful for you

我希望这对你有用

#3


3  

always You could use:

总是可以使用:

show create table <tablename>

#1


12  

This query will give you much more information than the describe statement:

这个查询将提供比描述语句更多的信息:

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

#2


53  

show full columns from <table_name>

This is the output:

这是输出:

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

I hope this is useful for you

我希望这对你有用

#3


3  

always You could use:

总是可以使用:

show create table <tablename>