Detailed explanation of the role of MySQL's own database

Mysql system database

1. sys system database The
sys database contains a series of stored procedures, custom functions and views to help us quickly understand the metadata information of the system. The sys system database combines information_schema and performance_schema related data, allowing us to retrieve metadata more easily.

2. performance_schema performance dictionary
This database provides important reference information for database performance optimization

3. mysql database
This database is also a core database, storing user authority information and help information.

4. sys system database The
sys database contains a series of stored procedures, custom functions and views to help us quickly understand the metadata information of the system. The sys system database combines information_schema and performance_schema related data, allowing us to retrieve metadata more easily.

4. INFORMATION_SCHEMA data dictionary

INFORMATION_SCHEMA data dictionary: This database stores the information (metadata) of all other databases. Metadata is data about data, such as database name or table name, column data type, or access permissions.

The main system table TABLES table of INFORMATION_SCHEMA library: Provides information about tables and views in the database. (The Table_schema field represents the name of the database to which the data table belongs) SELECT * FROinformation_schema.TABLES WHERE TABLE_SCHEMA='database name';

COLUMNS table: provides column information in the table. It describes in detail all the columns of a table and the information of each column. SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA='Database' AND TABLE_NAME='Table name'

TABLE_CONSTRAINTS table: store primary key constraints, foreign key constraints, unique constraints, check constraints. The description information of each field SELECT * FROM information_schema.TABLE_CONSTRAINTS WHERE TABLE_SCHEMA='database name' AND TABLE_NAME='table name'

STATISTICS table: Provides information about table indexes.
SELECT * FROM information_schema.STATISTICS WHERE TABLE_SCHEMA='Database name' AND TABLE_NAME='Table name'

Guess you like

Origin blog.csdn.net/weixin_45310323/article/details/112333668