yanggb

使用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数据库工具中提供的查看表结构的相关功能(一般都会有),会更方便快捷。

 

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

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-11-17
  • 2021-11-07
  • 2021-11-07
  • 2022-01-16
  • 2022-02-11
  • 2022-02-21
  • 2022-01-24
猜你喜欢
  • 2021-11-07
  • 2021-11-07
  • 2021-11-26
  • 2021-12-21
  • 2021-11-22
  • 2022-12-23
相关资源
相似解决方案