I used below to create a separate sql file that you can execute to pull files. tip: watch special characters in the file name
select concat('SELECT ad.thedata into DUMPFILE \'e:/temp/attachments/' , a.bug_id , '___' , ad.id , '___' , replace(a.filename,'\'','') , '\' FROM bugs.attachments a, bugs.attach_data ad where ad.id = a.attach_id' , ' and ad.id = ' , ad.id ,';') into outfile 'C:/Temp/attachments.sql' from bugs.attachments a, bugs.attach_data ad where ad.id = a.attach_id;
source share