注入前这些都不知道,需要经过以下步骤:
 
1:获取数据库名:
 
2:获取所有的数据库名:
- 
schemata:提供当前mysql中所有数据库库名信息,show databases()的结果就是取自于此; 
- 
shuse information_schema;使用库; 
- 
  
- 
通过information_schema中的schema_name获取数据库名,跟show databases()显示出来的一样; 
- 
  
- 
select schema_name from information_schema.schemata; 
 
- 
3:获取表名; 
- 
表tables,提供了关于数据库中的表的信息。详细表述了某个表属于哪个库,表类型,表引擎,创建时间等信息; 
- 
字段:table_name :表名。 
- 
字段:table_schema  :数据库名 
- 
查询指定数据库(book)中所有的表名和数据库名: 
- 
Select table_name from information_schema.tables where table_schema ='test'; 
后加where 指定数据库名限制;
 
4:columns表;
表columns,提供了表中的列信息,详细表述了某张表的所欲列以及每个列的信息。
查询得到字段名;
 
 
5:库名,表名,字段名都知道了。可以用:
select username,password from book.users;
从数据库中得到用户信息;