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

20

I encountered such a problem: Error Code: 1290. The MySQL server is running with the –secure-file-priv option so it cannot execute this statement when I tried to execute MySQL statement (Windows):

SELECT *
FROM xxxx
WHERE XXX
INTO OUTFILE 'report.csv'
    FIELDS TERMINATED BY '#'
    ENCLOSED BY '"'
    LINES TERMINATED BY '\n'

When I execute it without:

INTO OUTFILE 'report.csv'
    FIELDS TERMINATED BY '#'
    ENCLOSED BY '"'
    LINES TERMINATED BY '\n'

Then it works. Also, the same statement with INTO OUTFILE xxx actually worked before I reinstalled the MySQL server.

Anybody has ideas how to deal with this error?

Leave a Comment