MySQL元数据查询

Posted 最爱番茄炒蛋

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MySQL元数据查询相关的知识,希望对你有一定的参考价值。

查询数据库中所有表名

show tables;
# 也可以
select table_name from information_schema.tables where table_schema=‘xpydw‘ and table_type=‘base table‘;

查询指定数据库中指定表的所有字段名column_name

select column_name from information_schema.columns where table_schema=‘xpydw‘ and table_name=‘users‘

以上是关于MySQL元数据查询的主要内容,如果未能解决你的问题,请参考以下文章