Designed by 77
加载资源 ......
感谢 ♥ 作者
先不感谢了

mysql查看表结构

使用mysql查看表结构可以通过简单的命令达到目的。

假设有一个yanggb表。

1.desc/describle命令。

desc yanggb;
describle yanggb;

2.show命令。

show create table yanggb;
show columns from yanggb;
show fields from yanggb;
show full fields from yanggb;

此外,也可以通过查询mysql中的存储表定义的内置表来达到目的。

select * from information_schema.columns
where table_schema = 'db' -- 表所在数据库名
and table_name = 'yanggb'; -- 表名

当然,如果有现成的mysql数据库工具,还可以使用mysql数据库工具中提供的查看表结构的相关功能(一般都会有),会更方便快捷。

 

"生命中所有得到的礼物,早已在暗中标好了价格。"

posted @ 2021-05-07 20:50  yanggb  阅读(903)  评论(0编辑  收藏  举报