Importing rows from csv
Hey guys, hope you're doing well. So I'm trying to import rows from a local csv file to my MySQL db using this command:
LOAD DATA INFILE "./users.csv"
INTO TABLE users
COLUMNS TERMINATED BY ';';
but I get the following error:
ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
How can I do it without manually inserting the values one by one, or writing a script to do it?
7 Replies
Ended up writing a Python script
A classic solution. Will note this and close the thread. Cheers!
Ok so no bulk upload capability via LOAD INFILE? Must write python script to run an INSERT INTO for each row? (Railway MySQL hosted)
correct
Thanks sigh
it would have been cool if the op provided their python script
All good - I had already written the python. The insert speed on the hobby plan MySQL is just very slow; so I figured LOAD INFILE would be a faster alternative