Home >Database >Mysql Tutorial >How to query table information in mysql

How to query table information in mysql

王林
王林Original
2020-09-02 15:40:0124819browse

Mysql method of querying table information: Execute the [select * from tables where table_schema = "db_name";] command to view the information of all tables in the database.

How to query table information in mysql

The specific method is as follows:

Related learning recommendations: mysql tutorial (video)

Query the information of all tables in a table:

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

Query the information of a single table:

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

Query the information of all fields in a table:

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

This article From the php Chinese website mysql graphic tutorial channel, welcome to learn!

The above is the detailed content of How to query table information in mysql. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn