本教程操作环境windows10系统、mysql8.0.22版本、dell g3电脑。
mysql查看表的注释
查看表注释的方法
-- 在生成的sql语句中看 查看表生成的ddl 注意表名不加单引号
show create table 表名;– 在元数据的表里面看
use information,schema;select * from tables where table,schema='数据库名' and table,name='表名'拓展
创建表的时候写注释
create table t,user( id int(19) primary key auto,increment comment '主键', name varchar(300) comment '字段的注释', create,time date comment '创建时间')comment = '表的注释';修改表的注释
alter table 表名 comment '修改后的表的注释';修改字段的注释
alter table 表名 modify column 字段名 字段类型 comment '修改后的字段注释';--注意字段名和字段类型照写就行,如果之前有规定长度 这里也要指定一下
如alter table t,cal,res,channel modify column resume,channel varchar(30) comment '渠道'
推荐学习mysql视频教程
的方法是什么