MYSQL-INFORMATION_SCHEMA Information Database (MYSQL injection)

Source: Internet
Author: User

The system tables needed for mysql root permission injection... you can use the following tables to guess which databases have those tables and which fields finally obtain data ....

Directory

23.1. INFORMATION_SCHEMA table 23.1.1. INFORMATION_SCHEMA SCHEMATA table 23.1.2. INFORMATION_SCHEMA TABLES Table 23.1.3. INFORMATION_SCHEMA COLUMNS table 23.1.4. INFORMATION_SCHEMA STATISTICS table 23.1.5. INFORMATION_SCHEMA USER_PRIVILEGES table 23.1.6. INFORMATION_SCHEMA SCHEMA_PRIVILEGES table 23.1.7. INFORMATION_SCHEMA TABLE_PRIVILEGES table 23.1.8. INFORMATION_SCHEMA COLUMN_PRIVILEGES table 23.1.9. INFORMATION_SCHEMA CHARACTER_SETS Table 23.1 . 10. INFORMATION_SCHEMA COLLATIONS table 23.1.11. INFORMATION_SCHEMA COLLATION_CHARACTER_SET_APPLICABILITY table 23.1.12. INFORMATION_SCHEMA TABLE_CONSTRAINTS table 23.1.13. INFORMATION_SCHEMA KEY_COLUMN_USAGE table 23.1.14. INFORMATION_SCHEMA ROUTINES table 23.1.15. INFORMATION_SCHEMA VIEWS table 23.1.16. INFORMATION_SCHEMA TRIGGERS table 23.1.17. other INFORMATION_SCHEMA tables 23.2. the INFORMATION_SCHEMA extension of the SHOW statement provides a way to access database metadata.

Metadata is data about data, such as database name or table name, column data type, or access permission. In some cases, other terms used to express this information include "Data Dictionary" and "system directory ".
For example:

Mysql> SELECT table_name, table_type, engine-> FROM information_schema.tables-> WHERE table_schema = db5-> order by table_name DESC;


Table_name (Table Name) table_type (Table type)
Engine
V56 VIEW (VIEW) NULL
V3 VIEW)
NULL
V2 VIEW)
NULL
V VIEW)
NULL
Tables base table (basic TABLE) MyISAM
T7 base table (basic TABLE) MyISAM
T3 base table (basic TABLE) MyISAM
T2 base table (basic TABLE) MyISAM
T base table (basic TABLE) MyISAM
Pk base table (basic TABLE) InnoDB
Loop base table (basic TABLE) MyISAM
Kurs base table (basic TABLE) MyISAM
K base table (basic TABLE) MyISAM
Into base table (basic TABLE) MyISAM
Goto base table (basic TABLE) MyISAM
Fk2 base table (basic TABLE) InnoDB
Fk base table (basic TABLE) InnoDB

Set contains 17 rows (0.01 seconds ). Explanation: This statement requests to list all tables in db5 in reverse alphabetical order, but only three types of information are displayed: Table Name, table type, and table engine.
INFORMATION_SCHEMA is an information database that stores information about all other databases maintained by the MySQL server. There are several read-only tables in INFORMATION_SCHEMA. They are actually views rather than basic tables, so you won't be able to see any files related to them.

Each MySQL user has the right to access these tables, but is limited to specific rows in the Table. Such rows contain objects that the user has the right to access.

Advantages of SELECT

The purpose of the SELECT... FROM INFORMATION_SCHEMA statement is to provide a more consistent way to access information provided by the various SHOW statements supported by MySQL (show databases, show tables, and so on. Compared with SHOW, using SELECT has multiple advantages:
·
Comply with Codd rules. That is to say, all accesses are performed on tables.
·
You do not need to understand the syntax of the new statement. Since they already know how SELECT works, you only need to know the object name.
·
Developers do not have to worry about adding keywords.
·
There are millions of possible output changes, not one. In this way, it provides higher flexibility for applications with different requirements for metadata.
·
Since other DBMS also adopt this method, it is easier to port.

However, because SHOW is very popular among MySQL employees and users, if SHOW disappears, it may lead to confusion. Therefore, the traditional syntax cannot give enough reasons to eliminate SHOW. As a matter of fact, in MySQL 5.1, we also performed multiple enhancements to SHOW. For more information about this, see section 23.2, "SHOW statement extension ".

Standard
In MySQL, The INFORMATION_SCHEMA table structure is implemented in accordance with "ANSI/iso SQL: 2003 standard, Part 1 outline ". Our goal is to achieve close compatibility with SQL: 2003 core feature F021 "basic information solution.

Users of SQL Server 2000 (also following this standard) may have noticed their high similarity. However, MySQL omitted many columns unrelated to our implementation method and added some MySQL-specific columns. One of these columns is the engine column in The INFORMATION_SCHEMA.TABLES table.

Although other DBMS uses different names, such as syscat or system, the standard name is INFORMATION_SCHEMA.

In fact, although we do not need to generate a file named INFORMATION_SCHEMA, we still provide a new database named INFORMATION_SCHEMA. You can USE the USE statement to SELECT INFORMATION_SCHEMA as the default database, but the only way to access the tables contained in the database is to USE the SELECT statement. Content cannot be inserted, updated, or deleted.

Permission

There is no difference between the current permission (SHOW) requirements and the SELCET permission requirements. In any situation, to view information about an object, you must have specific permissions on the object.
23.1. INFORMATION_SCHEMA table


23.1.1. INFORMATION_SCHEMA SCHEMATA table 23.1.2. INFORMATION_SCHEMA TABLES Table 23.1.3. INFORMATION_SCHEMA COLUMNS table 23.1.4. INFORMATION_SCHEMA STATISTICS table 23.1.5. INFORMATION_SCHEMA USER_PRIVILEGES table 23.1.6. INFORMATION_SCHEMA SCHEMA_PRIVILEGES table 23.1.7. INFORMATION_SCHEMA TABLE_PRIVILEGES table 23.1.8. INFORMATION_SCHEMA COLUMN_PRIVILEGES table 23.1.9. INFORMATION_SCHEMA CHARACTER_SETS table 23.1.10. INFORMATION_SCHEMA COLLATIONS table 23.1.11. INFORMATION_SCHEMA COLLATION_CHARACTER_SET_APPLICABILITY table 23.1.12. INFORMATION_SCHEMA TABLE_CONSTRAINTS table 23.1.13. INFORMATION_SCHEMA KEY_COLUMN_USAGE table 23.1.14. INFORMATION_SCHEMA ROUTINES table 23.1.15. INFORMATION_SCHEMA VIEWS table 23.1.16. INFORMATION_SCHEMA TRIGGERS table 23.1.17. other INFORMATION_SCHEMA tables

Descriptions

In the following chapter, we select tables and columns in INFORMATION_SCHEMA. Each column has three types of information:
·
"Standard name": Specifies the standard SQL name of the column.
·
"SHOW Name": indicates the equivalent field name in the recent SHOW statement, if any.
·
The "comment" provides additional applicable information.

To avoid using names retained in standard or DB2, SQL Server, or Oracle, we changed the column name labeled as "SQL extension. (For example, in the TABLES Table, we change COLLATION to TABLE_COLLATION ). See the reserved word list at the end of this article. Html "> http://www.dbazine.com/gulutzan5.shtml.

The CHARACTER column (for example, TABLES. TABLE_NAME) is usually defined as VARCHAR (N) character set utf8, where N must be at least 64.

In each part, it indicates the SHOW statement equivalent to the SELECT statement for retrieving information from INFORMATION_SCHEMA, or this type of statement does not exist.
Note: At present, there are some lost columns and some messy columns. We are working on solving this problem and updating the document as it changes.
23.1.1. INFORMATION_SCHEMA SCHEMATA table


This solution is a database, so the SCHEMATA table provides information about the database.

Standard name
SHOW Name
Note
 
CATALOG_NAME
-
NULL
 
SCHEMA_NAME
 

Database
 
DEFAULT_CHARACTER_SET_NAME
 

 

 
DEFAULT_COLLATION_NAME
 

 

 
SQL _PATH
 

NULL
 

Note: The total value of the SQL _PATH column is NULL.

The following statements are equivalent:

SELECT SCHEMA_NAME AS 'databasefrom INFORMATION_SCHEMA.SCHEMATA [WHERE SCHEMA_NAME LIKE wild]
Show databases [LIKE wild] 23.1.2. INFORMATION_SCHEMA TABLES Table


The TABLES Table provides information about TABLES in the database.

Standard name
SHOW Name
Note
 
TABLE_CATALOG
 

NULL
 
TABLE_SCHEMA
Table _...
 

 
TABLE_NAME
Table _...
 

 
TABLE_TYPE
 

 

 
ENGINE
Engine
MySQL extension
 
VERSION
Version
MySQL extension
 
ROW_FORMAT
Row_format
MySQL extension
 
TABLE_ROWS
Rows
MySQL extension
 
AVG_ROW_LENGTH
Avg_row_length
MySQL extension
 
DATA_LENGTH
Data_length
MySQL extension
 
MAX_DATA_LENGTH
Max_data_length
MySQL extension
 
INDEX_LENGTH
Index_length
MySQL extension
 
DATA_FREE
Data_free
MySQL extension
 
AUTO_INCREMENT
Auto_increment
MySQL extension
 
CREATE_TIME
Create_time
MySQL extension
 
UPDATE_TIME
Update_time
MySQL extension
 
CHECK_TIME
Check_time
MySQL extension
 
TABLE_COLLATION
Collation
MySQL extension
 
CHECKSUM
Checksum
MySQL extension
 
CREATE_OPTIONS
Create_options
MySQL extension
 
TABLE_COMMENT
Comment
MySQL extension
 

Note:
·
TABLE_SCHEMA and TABLE_NAME are single fields displayed in SHOW, such as Table_in.

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.