mysql comments

  

mysql comment

Table comment

add comment during creating table

create table mytable(
id int not null default 0 comment 'user id') comment='table comment'

alter table comment

alter table mytable comment 'table comment'

check table moment

show create table <mytable>

show table status where name='mytable'

select table_name, table_comment from information_schema.tables where table_name='mytable'

Column comment

add comment during creating table

create table mytable(
id int not null default 0 comment 'user id')

alter column comment

alter table mytable modify column <fiedld_name> <type> comment 'column comment'

check table comment

show full columns from table

select column_name, column_comment from information_schema.columns where table_name='mytable'

 

posted @ 2019-04-12 17:40  redstar9451  阅读(252)  评论(0编辑  收藏  举报