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
willy5943
willy59432y ago
Ended up writing a Python script
JustJake
JustJake2y ago
A classic solution. Will note this and close the thread. Cheers!
WShulerC
WShulerC12mo ago
Ok so no bulk upload capability via LOAD INFILE? Must write python script to run an INSERT INTO for each row? (Railway MySQL hosted)
Brody
Brody12mo ago
correct
WShulerC
WShulerC12mo ago
Thanks sigh
Brody
Brody12mo ago
it would have been cool if the op provided their python script
WShulerC
WShulerC12mo ago
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