MySQL 添加、查看字段注释

 

语法:

创建表时的COMMENT内容,要查看这些内容,使用命令:


show full fields from '表名称';

 查看tb_usr表字段注释:

 

创建新表的脚本中, 可在字段定义脚本中添加comment属性来添加注释:

create table test( 
    id int not null default 0 comment '用户id' ) 

修改表的注释

alter table test1 comment '修改后的表的注释';


修改字段的注释

alter table test1 modify column field_name int comment '修改后的字段注释'; 

--注意:字段名和字段类型照写就行





posted @ 2017-05-11 20:08  快乐的咸鱼  阅读(19225)  评论(0编辑  收藏  举报