1.-- 查看表结构
desc 表名;
主要是字段类型,主键,是否允许为空等。
2. 查看表中字段的结构信息
可以用来查看表中字段的注释等,比如
select table_name,column_name,column_comment from information_schema.columns where table_schema ='表所在的库' and table_name = '要查看的表名' ;
3.查看库里面表的结构信息
可以用来查看表的注释信息
select table_name,table_comment from information_schema.tables where table_schema = '表所在的库' and table_name ='表名' ;
去掉 table_name 限定条件,即可查看指定库中的所有表信息
4.查看表的ddl语句
show create table 表名;
您可能感兴趣的文章:
如您对本文有疑问或者有任何想说的,请 点击进行留言回复,万千网友为您解惑!
网友评论