mysql 显示表结构

方法1

desc tabl_name;

方法2:

查询表中列的注释信息
select * from information_schema.columns
where table_schema = 'db' #表所在数据库
and table_name = 'tablename' ; #你要查的表

方法3:

只查询列名和注释
select column_name, column_comment from information_schema.columns where table_schema ='db' and table_name = 'tablename' ;

方法4:

查看表的注释
select table_name,table_comment from information_schema.tables where table_schema = 'db' and table_name ='tablename'

方法5:

查看表生成的DDL
show create table table_name;

posted @ 2021-10-20 10:15  枫叶艾辰  阅读(434)  评论(0编辑  收藏  举报