ERROR 1290 (HY000): .. MySQL server running with --secure-file-priv option

workspace
mysql

#1

Hi there, have run the following query (as a test) on my mysql-php workspace.

SELECT *FROM
whatevertable
WHERE
ActiveStatus = '1’
INTO OUTFILE '/Users/Macbook/Desktop/csv/prova.csv’
FIELDS ENCLOSED BY '"'
TERMINATED BY ';'
ESCAPED BY '"'
LINES TERMINATED BY ‘\r\n’;

when i try to run it, i get:

mysql> whateverfilename.sql
ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

Maybe SQL is wrong too, don’t know, but am sure i first need to set something to MYSQL first.

is there a way to solve this? is there a guide?

Cheers,
brainwashed


#2

It looks like your MySQL server is configured differently to how you expect. Take a look at this link for some pointers: https://stackoverflow.com/questions/32737478/how-should-i-tackle-secure-file-priv-in-mysql.


#3

abaliss, thanks a lot…

but how do i edit the my.ini (or whatever is called) file on Cloud9?

If i type what suggested in the link

SHOW VARIABLES LIKE “secure_file_priv”;
It tells me that i can load files to

/var/lib/mysql-files/

but i cannot find such directory… where is it?

Thanks


#4

nobody can help?
can i edit configuration file for mysql?

even if i am able to do so, will i be able to export directly or not?

Thanks


#5

The my.cnf file is located in /etc/mysql/my.cnf by default. Take a look at this StackOverflow post for more information :smiley: