MySQL view database, table, field information

Source: Internet
Author: User
Tags mysql view

Query MySQL database/SQL statements for table-related information: SHOW DATABASES//lists the MySQL Server databases. SHOW TABLES [from db_name]//lists the database data tables. SHOW CREATE TABLES Tbl_name//Export the data table structure. SHOW TABLE STATUS [from db_name]//lists data tables and table state information. SHOW COLUMNS from Tbl_name [from Db_name]//List table fieldsSHOW fields from Tbl_name [from Db_name],describe tbl_name [Col_name]. SHOW full COLUMNS from Tbl_name [from db_name]//list fields and detailsSHOW full fields from Tbl_name [from Db_name]//list Field Full propertiesSHOW INDEX from Tbl_name [from Db_name]//lists the table indexes. SHOW STATUS//Lists the DB Server status. SHOW VARIABLES//lists the MySQL system environment variables. SHOW processlist//lists the execution commands. SHOW GRANTS for user//List A user right

$res = mysql_query ("SHOW full COLUMNS from table");  while ($row = mysql_fetch_array ($res)) {    //  echo ' field name: '. $row [' field ']. ' -Data type: '. $row [' type ']. ' -Note: '. $row [' Comment '];     Print_r ($row);}

MySQL view database, table, field information

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.