How to display MYSQL table information

Source: Internet
Author: User

The MYSQL table information display method is a feature that we often implement. The following describes how to display MYSQL table information. If you are interested in MYSQL table information, take a look.

When using mysql (show tables), you sometimes need to check whether the table and field related information tables and a field exist .)~~ PHP provides such related functions, such as mysql_list_dbs) and mysql_list_fields), but the mysql_list_fields () functions are outdated. Therefore, you must use the show... SQL command to search for them.

SHOW command (optional in)

# Display names of all databases in mysql

Show databases;

# Display related tables in mysql

Show tables [from db_name]

# Viewing the Stored Procedure status

Show procedure status

# Show the column names in the table

Show columns from table_name [from database_name]; or show columns from database_name.table_name;

# Display the permissions of a user. The result is similar to the grant command.

Show grants for user_name;

# Display table Indexes

Show index from table_name

# Display information about specific system resources, such as the number of running threads

Show status [from db_name]

# Display the name and value of the system variable

Show [global] variables

# Display all processes running in the system, that is, the query currently being executed. Most users can view their own processes, but if they have the process permission, they can view all processes, including Password

Show processlist

# Display the information of each table in the currently used or specified database, including the table type and the latest update time of the table

Show table status

# Display different permissions supported by the server

Show privileges

# Whether the create database statement can create a specified database

Show create database database_name

# Whether the create database statement can create a specified database

Show create table table_name

# Display available storage engines and default engines after installation

Show engies

# Display the innoDB Storage engine status

Show innodb status

# Display BDB storage engine logs

Show logs ----- This is abandoned

# Display errors, warnings, and notifications generated by the last executed statement

Show warnings

# Only display Errors generated by the last statement.

Show errors

# Display available storage engines and default engines after installation

Show [storage] engines;

========================================================== ================================

Mysqlshow. This command only displays information about databases, tables, and columns.

For example, mysqlshow-uroot-pXXXX mysql # displays mysql database information

For example, mysqlshow-uroot-pXXXX mysql user # displays the user table information in the mysql database.

For example, mysqlshow-uroot-pXXXX mysql user # displays information about the user column in the user table of the mysql database.

Three Common MySQL table creation statements

MySQL connection Query

How to Implement MySQL multi-Table insertion

Two tips for MySQL table repair

Restrictions on Functions of MySQL partition tables

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.