New to MySQL so I’ll explain this as best I can. All of the following is Ubuntu based. I’m having trouble loading a huge (27m row) file in. The issue is that the solution to one problem is, seemingly, the cause of another problem. Details below. I’ve tried MySQL workbench but it’s painfully slow – too slow for such a large file so I’m told LOAD DATA etc is the way to go.
I’ve setup the db and created the appropriate table so I’m trying:
LOAD DATA LOCAL INFILE ‘/path/to/csv’ INTO TABLE mytable FIELDS TERMINATED BY ‘,’ ENCLOSED BY ‘”‘;
This gives: “file request rejected due to restrictions on access.”
I’ve checked there are no permissions issues. My googling tells me the issue here is the “LOCAL”, but when I try removing the LOCAL from the above to get:
LOAD DATA FNFILE ‘/path/to/csv’ INTO TABLE mytable FIELDS TERMINATED BY ‘,’ ENCLOSED BY ‘”‘;
then I get
“The MySQL server is running with the –secure-file-priv option so it cannot execute this statement”
Apparently this is to do with /etc/mysql/mysql.conf.d/mysqld.cnf where there is a setting for secure-file-priv. I have, thanks to more googling, set this to secure-file-priv = ”
So in short, “LOAD DATA LOCAL” gives me a “file request restricted” and “LOAD DATA” gives me another error. Neither of these I can get around. Can anyone offer a solution?
Thanks
RDMBrummie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.