SQL and secure_file_priv

Reminder of how to export from mysql when you run into the secure_file_priv message!

to find what its set at currently from within sql


SELECT @@global.secure_file_priv;

to export stuff to csv

SELECT * INTO OUTFILE '/var/lib/mysql-files/somefile.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n' FROM sometable;

This entry was posted in coding, computing, mysql. Bookmark the permalink.

Leave a Reply