mysql查询表信息的方法

这篇文章将为大家详细讲解有关mysql查询表信息的方法,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。

mysql查询表信息的方法:执行【select * from tables where table_schema = "db_name";】命令可以查看数据库中所有表的信息。

mysql查询表信息的方法

具体方法如下:

查询一个里面所有表的信息:

use information_scheam;
select * from tables where table_schema = "db_name";

查询单个表的信息:

use information_scheam;
select * from tables where table_schema = "db_name" and table_name = "table_name1";

查询一张表的所有字段信息:

use db_name;
show full columns from table_name1;
show full columns from table_name2;

关于mysql查询表信息的方法就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。