I have a database which I have been LOADING text files, these were stored in /tmp.

for reasons of permits however this morning when I turn the computer the files were no longer in that folder and attempt the LOAD gives me the next

ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it can not execute esta statement

I had any problems to use the LOAD so far what could be?

  • That option contains a directory name. When it's set, you can only load files from that directory. So if you have --secure-file-priv=/tmp, you can only load from /tmp. – Barmar Oct 21 '16 at 21:25
  • Read dev.mysql.com/doc/refman/5.7/en/… – Barmar Oct 21 '16 at 21:26
  • I already configure my.cnf file and put [mysqld]: secure_file_priv=NULL and it didnt work yet – Carolina Aguilar Oct 21 '16 at 21:36
  • What version of MySQL? NULL became valid in 5.7.6, and it means that you can't use LOAD DATA INFILE at all. – Barmar Oct 21 '16 at 21:37
  • I gave you a link to the documentation, it explains it in great detail. You should be able to figure out the value you want from that. – Barmar Oct 21 '16 at 21:39
  • /tmp is, by design, cleared on reboot. This cleans up certain trash that might be left behind by a crash. And it is a security feature.

  • LOAD FILE INFILE is a security hole waiting for hackers to march in. 5.7 (finally) got serious about it, and partially plugged it by having --secure-file-priv.

| improve this answer | |
  • Please could you elaborate on what the security issues are with LOAD DATA INFILE? I've been searching around and all I have found are instructions for how to disable it but no information as to why it was implemented in the first place. – ec2011 Oct 22 '18 at 16:10

Your Answer

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