获取mysql表注释以及列注释
sshong 发表于2014年11月13日 15:56:32 更新于2014年11月13日 15:56:32
获取表注释:
use xx_database;
show table status;
最后一列就是
+-----------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+---------+
| Name            | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time         | Update_time | Check_time | Collation       | Checksum | Create_options | Comment |
+-----------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+---------+
| game         | InnoDB |      10 | Compact    |    0 |              0 |       16384 |               0 |            0 |   7340032 |              1 | 2014-11-13 15:18:13 | NULL        | NULL       | utf8_general_ci |     NULL |                |         |
| goods        | InnoDB |      10 | Compact    |    0 |              0 |       16384 |               0 |            0 |   7340032 |              1 | 2014-11-13 15:20:18 | NULL        | NULL       | utf8_general_ci |     NULL |                |         |

获取列注释:
show full fields from xxx_table;
最后一列就是
+------------+------------------+-----------------+------+-----+---------+----------------+---------------------------------+---------+
| Field      | Type             | Collation       | Null | Key | Default | Extra          | Privileges                      | Comment |
+------------+------------------+-----------------+------+-----+---------+----------------+---------------------------------+---------+
| id         | int(10) unsigned | NULL            | NO   | PRI | NULL    | auto_increment | select,insert,update,references |         |
| name       | varchar(200)     | utf8_general_ci | NO   |     | NULL    |                | select,insert,update,references |         |
| url        | varchar(1000)    | utf8_general_ci | NO   |     | NULL    |                | select,insert,update,references |         |
| created_at | int(10) unsigned | NULL            | NO   |     | NULL    |                | select,insert,update,references |         |
| updated_at | int(10) unsigned | NULL            | NO   |     | NULL    |                | select,insert,update,references |         |
+------------+------------------+-----------------+------+-----+---------+----------------+---------------------------------+---------+
标签:无分类:Webserver阅读:4907
评论
暂无评论
添加评论
您的大名,限长10汉字,20英文(*)
电子信箱(*)
您的网站
正文,限长500汉字,1000英文(*)
验证码(*) 单击刷新验证码
联系我
博客订阅