一、字段注释
1、获取表注释
select COLUMN_COMMENT as comment from INFORMATION_SCHEMA.COLUMNS where table_name = '表名称' and column_name = '字段名称' and table_schema = '数据库名称'
2、修改表注释
alter table 表名称 modify column 字段名称 字段类型 comment 注释
二、表注释
1、获取表注释
show table status from 数据库名称 like '表名称'
得到的是一个数组,取Comment即可
2、修改表注释
alter table 表名称 comment 修改后的表的注释