1.基本介绍
Mysql version>5.0 存在该库
可以当作整个数据库的索引字典,利用它可以查询(爆破)指定库名,列名,表名等。
4.0以上支持union
4.1以上支持子查询
2.特殊库中的常用表
SCHEMATA:可查询库信息
TABLES:可查询表信息
COLUMNS:查询列名
3.通过特殊库查询信息
3.1.查询数据库
select schema_name from information_schema.schemata;
mysql> select schema_name from information_schema.schemata;
+--------------------+
| SCHEMA_NAME |
+--------------------+
| mysql |
| information_schema |
| performance_schema |
| sys |
| students |
+--------------------+
5 rows in set (0.00 sec)
3.2 查询数据表
select table_name from information_schema.tabels where table_schema="students";
mysql> select table_name from information_schema.tables where table_schema='students';
+------------+
| TABLE_NAME |
+------------+
| class |
+------------+
1 row in set (0.00 sec)
3.3查询字段
select column_name from information_schema.columns where table_name="class";
mysql> select column_name from information_schema.columns where table_name="class";
+-------------+
| COLUMN_NAME |
+-------------+
| id |
| name |
| password |
+-------------+
3 rows in set (0.00 sec)
3.4查询数值
select id,username,password from class;
mysql> select column_name from information_schema.columns where table_name="class";
+-------------+
| COLUMN_NAME |
+-------------+
| id |
| name |
| password |
+-------------+
3 rows in set (0.00 sec)