33

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    |                |
+-------+---------------------+------+-----+---------+----------------+
Wang Zhong
  • 125
  • 2
  • 9
MonoThreaded
  • 11,429
  • 12
  • 71
  • 102

3 Answers3

101
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

fancyPants
  • 50,732
  • 33
  • 89
  • 96
Karl
  • 1,026
  • 2
  • 8
  • 2
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
Lukas Eder
  • 211,314
  • 129
  • 689
  • 1,509
10

always You could use:

show create table <tablename>
Marek Lisiecki
  • 199
  • 3
  • 4