I'm trying to load a non-regular file with MySQL:

select load_file ('/proc/cmdline')

It returns NULL

So I checked the documents here,

  1. the file is readable, because as mysql user, I can execute cat /proc/cmdline from the host
  2. the file didn't exceed size limit, because reading of /etc/passwd works, which is larger than that
  3. I didn't set secure_file_priv variable, show variables like 'secure_file_priv' shows an empty result

Any ideas?

load data local infile '/proc/cmdline' works

  • What is a non-regular file? Minority? – Philᵀᴹ Jan 20 '14 at 1:48
  • @Phil Non regular files are like pipes, device files, sockets etc. from stat.h I think – daisy Jan 20 '14 at 2:21
  • Oh, right. I guess it won't work if it tries any kind of seeking.... – Philᵀᴹ Jan 20 '14 at 8:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.