0
select code,gtin into OUTFILE "E:/testfile.txt" FIELDS TERMINATED BY '|' 
 LINES TERMINATED BY '\n'
 FROM viewassigncodejpsblp where length(code) > 0

I got stuck in a problem when i run this query in mysql workbench 5.7 it shows me this

error :Error Code: 1290. The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

i have changed the my.ini file by commenting out the secure-file-priv line than i ran the query

show variables like secure_file_priv

the query returned null moreover i have also restarted mysql and my computer as well but still getting the error code 1290:

Lelio Faieta
  • 6,457
  • 7
  • 40
  • 74

1 Answers1

0

Specifically for anyone who's stuck on this issue while trying to upgrade from mySQL 5.6 or mySQL 5.x to mySQL 8.0 or mySQL 8.x, this may be your answer.

The option "secure-file-priv" must be set, but with no value in order to read from other directories.

In MySQL Workbench 8.0, this means the Administration > Options File > Security Tab > secure-file-priv checkbox must be checked but the field left empty.

option setting in MySQL Workbench 8.0

In the my.ini configuration file, the entry appears as

secure-file-priv = 

This is repeating more detailed information in this post.

wistlo
  • 250
  • 3
  • 11