Mysql注入常用知识

一、默认安装有四个数据库:

1、information_schema 
2、mysql 
3、performance_schema
4、test

二、查询语句:

select * from 库名.表名   //查看表中所有元素
insert into 表名(字段1,字段2) values ('1','2')  //在表中插入
delete from 表名 条件     //删除表
drop 库名           //删除数据库
update 表名 set 字段名='' where   //更新

三、常用的命令:

union select 联合查询,注:前后的字段必须相同
order by 字段名 desc/asc 排序
Group_concat(字段名) 显示字段中所有的内容
Select substring(字符串,要截取字段内容的起始位置,截取长度)
limit 0,1 (limit a,b) 查询结果的从a-1行开始往下b行:
Sleep(10) 睡眠10秒
select @@basedir 查询数据库安装路径
select @@datadir 查询数据库所在目录
select version() 查询版本
select database()查询当前数据库名字

四、查库,查表,查字段:

查所有的数据库名:

select schema_name from information_schema.schemata

查某库中所有的表:

Select table_name from information_schema.tables where table_schema=’库名’

查某个库中表的所有字段名:

Select column_name from information_schema.columns where table_schema=’库名’ and table_name=’表名’

发表评论

邮箱地址不会被公开。 必填项已用*标注