mysql表與字段注釋檢視修改

2021-08-31 06:55:01 字數 686 閱讀 6041

1、 建立表的時候寫注釋

create table 表名

( 欄位名 int comment '欄位的注釋'

)comment='表的注釋';

2、修改表的注釋

alter table 表名 comment '修改後的表的注釋';

3、修改欄位的注釋

alter table 表名 modify column 欄位名 字段型別 comment '修改後的字段注釋';

4、 檢視表注釋的方法

–在生成的sql語句中看

show create table 表名;

–在元資料的表裡面看

use information_schema;

select * from tables where table_schema='資料庫名' and table_name='表名'

5、檢視字段注釋的方法

–show

show full columns from 表名;

–在元資料的表裡面看

select * from columns where table_schema='資料庫名' and table_name='表名'

mysql 修改表注釋 字段注釋 檢視與修改注釋

2018年5月23日 1 建立表的時候寫注釋 create table test1 field name int comment 欄位的注釋 comment 表的注釋 2 修改表的注釋 alter table test1 comment 修改後的表的注釋 3 修改欄位的注釋 alter table ...

mysql新增表注釋 字段注釋 檢視與修改注釋

1 建立表的時候寫注釋 create table test1 field name int comment 欄位的注釋 comment 表的注釋 2 修改表的注釋 alter table test1 comment 修改後的表的注釋 3 修改欄位的注釋 alter table test1 modif...

mysql新增表注釋 字段注釋 檢視與修改注釋

1 建立表的時候寫注釋 create table test1 field name int comment 欄位的注釋 comment 表的注釋 2 修改表的注釋 alter table test1 comment 修改後的表的注釋 3 修改欄位的注釋 alter table test1 modif...