I'm trying to run the following on a MySQL database:
SELECT * FROM mysql.db INTO OUTFILE "C:\ProgramData\MySQL\MySQL Server 5.7\Uploads\db.csv" FIELDS TERMINATED BY '|' ENCLOSED BY '"' LINES TERMINATED BY '\n'; I get the error:
SQL Error (1290): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement When I run the following:
mysql> SELECT @@secure_file_priv; I get:
+------------------------------------------------+ | @@secure_file_priv | +------------------------------------------------+ | C:\ProgramData\MySQL\MySQL Server 5.7\Uploads\ | +------------------------------------------------+ So why is it not exporting the file even though I am using the set --secure-file-priv location?
I am used to MSSQL and new to MySQL.
mysql> select * from sometable into outfile 'c:\\ProgramData\\MySQL\\MySQL Server 5 .7\\Uploads\\out.txt';Clue is to use double backslash.